@sveltia/cms 0.8.2 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,20 @@
1
1
  # Sveltia CMS
2
2
 
3
- Sveltia CMS is a Git-based lightweight headless CMS under active development as a quick replacement for [Netlify/Decap CMS](https://decapcms.org/). You can use it with your favourite static site generator like SvelteKit, Eleventy, Next.js and Hugo to manage content as static files in a Git repository. The open source alternative to Netlify/Decap CMS is now in public beta — with more features to come.
3
+ Sveltia CMS is a Git-based lightweight headless CMS under active development as a modern, quick replacement for [Netlify/Decap CMS](https://decapcms.org/). You can use it with your favourite static site generator like SvelteKit, Eleventy, Next.js and Hugo to manage content as static files in a Git repository. The free open source alternative to Netlify/Decap CMS is now in public beta — with more features to come.
4
4
 
5
- ![Screenshot: Git-based Headless CMS with Dark Mode](docs/screenshot-20231120-1.webp)<br>
5
+ ![Screenshot: Git-based Headless CMS with Dark Mode](docs/screenshot-1-20231124.webp)<br>
6
6
 
7
- ![Screenshot: Instant Entry Listing, Searching and Saving](docs/screenshot-20231120-2.webp)<br>
7
+ ![Screenshot: Instant Entry Listing, Searching, Saving](docs/screenshot-2-20231124.webp)<br>
8
8
 
9
- ![Screenshot: Stock Photo Integration with Pexels, Pixabay and Unsplash](docs/screenshot-20231120-3.webp)<br>
9
+ ![Screenshot: Stock Photo Integration with Pexels, Pixabay and Unsplash](docs/screenshot-3-20231124.webp)<br>
10
10
 
11
- ![Screenshot: All-New Asset Library; Full Internationalization Support with DeepL](docs/screenshot-20231120-4.webp)<br>
11
+ ![Screenshot: All-New Asset Library; Full Internationalization Support with DeepL](docs/screenshot-4-20231124.webp)<br>
12
12
 
13
- ![Screenshot: Single-Line Migration from Netlify/Decap CMS (depending on your current setup)](docs/screenshot-20231120-5.webp)<br>
13
+ ![Screenshot: Easy Local Workflow; Single-Line Migration from Netlify/Decap CMS (depending on your current setup); Sveltia CMS](docs/screenshot-5-20231124.webp)<br>
14
14
 
15
15
  ## Motivation
16
16
 
17
- Sveltia CMS was born in November 2022, when the progress of Netlify CMS was stalled for more than six months. [@kyoshino](https://github.com/kyoshino)’s clients wanted to replace their Netlify CMS instances without much effort, mainly to get better internationalization support.
17
+ Sveltia CMS was born in November 2022, when the progress of Netlify CMS was stalled for more than six months. [@kyoshino](https://github.com/kyoshino)’s clients wanted to replace their Netlify CMS instances without much effort, mainly to get better internationalization (i18n) support.
18
18
 
19
19
  To achieve radical improvements in UX, performance and i18n, it was decided to build an alternative from the ground up, while ensuring an easy migration path from the other. After proving the concept with a rapid [Svelte](https://svelte.dev/) prototype, development was accelerated to address their primary use cases. The new offering has since been released as open source software to encourage wider adoption.
20
20
 
@@ -69,7 +69,7 @@ Here are some highlights mainly compared to Netlify/Decap CMS:
69
69
  - [Integrates DeepL](#use-deepl-to-translate-entry-fields) to allow translation of text fields from another locale with one click.
70
70
  - You can [disable non-default locale content](#disable-non-default-locale-content)[^15].
71
71
  - You can [use a random UUID for an entry slug](#use-a-random-id-for-an-entry-slug), which is a good option for locales that write in non-Latin characters[^12].
72
- - Resolves limitations in the Netlify/Decap CMS [list and object widgets](https://decapcms.org/docs/beta-features/#i18n-support) so that changes made with these widgets will be duplicated between locales as expected when using the `i18n: duplicate` field configuration[^7].
72
+ - Resolves the [limitations in the list and object widgets](https://decapcms.org/docs/beta-features/#i18n-support) so that changes made with these widgets will be duplicated between locales as expected when using the `i18n: duplicate` field configuration[^7].
73
73
 
74
74
  ### Collection enhancements
75
75
 
@@ -80,16 +80,20 @@ Here are some highlights mainly compared to Netlify/Decap CMS:
80
80
  ### Field enhancements
81
81
 
82
82
  - Required fields, not optional fields, are clearly marked for efficient data entry.
83
- - Integration with Pexels, Pixabay and Unsplash makes it easy to insert free stock photos into image fields[^8].
83
+ - Provides a reimagined all-in-one asset selection dialog for file and image fields.
84
+ - [Collection-specific assets](#use-a-custom-media-folder-for-a-collection) will be listed first for easy selection, while all assets can also be displayed in a separate tab[^19].
85
+ - New assets can be uploaded by dragging & dropping them into the dialog[^20].
86
+ - A file/image URL can also be entered in the dialog.
87
+ - Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert free stock photos[^8].
84
88
  - Optional object fields (`widget: object` with `required: false`) can be manually added or removed. If removed, the required subfields will no longer trigger validation errors[^16].
85
89
  - You can revert changes to all fields or a specific field.
86
90
 
87
- ### Asset Library enhancements
91
+ ### Asset management enhancements
88
92
 
89
- - A completely new Asset Library, built separately from the image selection dialog, makes it easy to manage all of your files, including images and documents.
93
+ - A completely new Asset Library, built separately from the image selection dialog, makes it easy to manage all of your files, including images, videos and documents.
90
94
  - You can sort or filter assets by name or file type and view asset details, including size, dimensions, and a list of entries that use the selected asset.
91
95
  - You can upload multiple assets at once, including files in nested folders, by browsing or dragging & dropping them into the media library[^5].
92
- - You can navigate between the global media folder and a per-collection media folder[^6].
96
+ - You can navigate between the global media folder and per-collection media folders[^6].
93
97
 
94
98
  ## Compatibility
95
99
 
@@ -157,12 +161,13 @@ While it’s not our goal to recreate all the features found in Netlify/Decap CM
157
161
 
158
162
  - [Svelte 5](https://svelte.dev/blog/runes) migration
159
163
  - Further Netlify/Decap CMS compatibility, including Editorial Workflow
160
- - Config editor[^10]
161
- - Mobile support[^18]
164
+ - [Localization](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md)
162
165
  - Documentation
163
166
  - Marketing site
164
167
  - Demo site
165
168
  - Starter templates
169
+ - Config editor[^10]
170
+ - Mobile support[^18]
166
171
 
167
172
  ## Getting started
168
173
 
@@ -205,9 +210,11 @@ You can use Sveltia CMS with a local Git repository, like the [beta feature](htt
205
210
  1. Click “Work with Local Repository” and select the project’s root directory once prompted.
206
211
  1. Make some changes to your content on Sveltia CMS.
207
212
  1. See if the produced changes look good using `git diff` or a GUI like [GitHub Desktop](https://desktop.github.com/).
208
- 1. Open the dev site at `http://localhost:[port]/` to check the rendered results.
213
+ 1. Open the dev site at `http://localhost:[port]/` to check the rendered pages.
209
214
  1. Commit and push the changes if satisfied, or discard them if you’re just testing.
210
215
 
216
+ Remember that the local repository support doesn’t do any Git operation. You have to pull, commit and push all changes manually with a Git client. Also, at this point, you have to reload the CMS to see the latest content after fetching remote updates (this will be unnecessary once browsers support the proposed `FileSystemObserver` API).
217
+
211
218
  ### Use a custom icon for a collection
212
219
 
213
220
  You can have an icon for each collection for easy identification in the collection list.
@@ -349,11 +356,11 @@ Importing the CMS as an npm package is not supported yet.
349
356
 
350
357
  Visit the [Discussions](https://github.com/sveltia/sveltia-cms/discussions) page on this GitHub repository and start a new discussion. Tell us about your use cases!
351
358
 
352
- Want to build a website with Sveltia CMS? [@kyoshino](https://github.com/kyoshino) is available for hire depending on your requirements.
359
+ Want to build a website with Sveltia CMS? Maintainer [@kyoshino](https://github.com/kyoshino) is available for hire depending on your requirements.
353
360
 
354
361
  ## Contributions
355
362
 
356
- Sveltia CMS is still in early beta, so we do expect various problems. Please [report any bugs to us](https://github.com/sveltia/sveltia-cms/issues/new). Feel free to submit feature requests as well. Meanwhile, pull requests may not be accepted for the time being due to limited review resources. As we get closer to the 1.0 release, we’ll be welcoming localizers.
363
+ Sveltia CMS is still in early beta, so we do expect various problems. Please [report any bugs to us](https://github.com/sveltia/sveltia-cms/issues/new). Feel free to submit feature requests as well. Meanwhile, pull requests may not be accepted for the time being due to limited review resources. As we get closer to the 1.0 release, we’ll be welcoming [localizers](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md).
357
364
 
358
365
  ## Related Links
359
366
 
@@ -373,7 +380,7 @@ This software is provided “as is” without any express or implied warranty. T
373
380
  [^8]: [Netlify/Decap CMS #2579](https://github.com/decaporg/decap-cms/issues/2579)
374
381
  [^9]: [Netlify/Decap CMS #3505](https://github.com/decaporg/decap-cms/issues/3505)
375
382
  [^10]: [Netlify/Decap CMS #341](https://github.com/decaporg/decap-cms/issues/341)
376
- [^11]: [Netlify/Decap CMS #1382](https://github.com/decaporg/decap-cms/issues/1382) and many more. We’ll be updating this list after reviewing their issue list.
383
+ [^11]: [Netlify/Decap CMS #1382](https://github.com/decaporg/decap-cms/issues/1382), [Netlify/Decap CMS #5596](https://github.com/decaporg/decap-cms/issues/5596) and many more. We’ll be updating this list after reviewing their issue list.
377
384
  [^12]: [Netlify/Decap CMS #1975](https://github.com/decaporg/decap-cms/issues/1975)
378
385
  [^13]: [Netlify/Decap CMS #5112](https://github.com/decaporg/decap-cms/issues/5112)
379
386
  [^14]: [Netlify/Decap CMS #4635](https://github.com/decaporg/decap-cms/issues/4635), [Netlify/Decap CMS #5920](https://github.com/decaporg/decap-cms/issues/5920), [Netlify/Decap CMS #6410](https://github.com/decaporg/decap-cms/issues/6410)
@@ -381,3 +388,5 @@ This software is provided “as is” without any express or implied warranty. T
381
388
  [^16]: [Netlify/Decap CMS #2103](https://github.com/decaporg/decap-cms/issues/2103)
382
389
  [^17]: [Netlify/Decap CMS #1333](https://github.com/decaporg/decap-cms/issues/1333)
383
390
  [^18]: [Netlify/Decap CMS #441](https://github.com/decaporg/decap-cms/issues/441)
391
+ [^19]: [Netlify/Decap CMS #5910](https://github.com/decaporg/decap-cms/issues/5910)
392
+ [^20]: [Netlify/Decap CMS #4563](https://github.com/decaporg/decap-cms/issues/4563)
@@ -220,7 +220,8 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
220
220
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
221
221
  `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent&&n.sep;let s=[];if(i&&n.sep&&!n.value){const l=[];for(let r=0;r<n.sep.length;++r){const o=n.sep[r];switch(o.type){case"newline":l.push(r);break;case"space":break;case"comment":o.indent>e.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(s=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!di(n.start,"explicit-key-ind")?n.start.push(this.sourceToken):i||n.value?(s.push(this.sourceToken),e.items.push({start:s})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}),this.onKeyLine=!0;return;case"map-value-ind":if(di(n.start,"explicit-key-ind"))if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(di(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(rw(n.key)&&!di(n.sep,"newline")){const l=$l(n.start),r=n.key,o=n.sep;o.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:r,sep:o}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(di(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=$l(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):di(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);i||n.value?(e.items.push({start:s,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(e);if(l){i&&l.type!=="block-seq"&&di(n.start,"explicit-key-ind")&&e.items.push({start:s}),this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||di(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i&&i.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const s=na(i),l=$l(s);Yp(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:l,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
222
222
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
223
- `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=na(e),i=$l(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i}]}}case"map-value-ind":{this.onKeyLine=!0;const n=na(e),i=$l(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function ow(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new lw||null,prettyErrors:e}}function q8(t,e={}){const{lineCounter:n,prettyErrors:i}=ow(e),s=new Kd(n?.addNewLine),l=new Wd(e),r=Array.from(l.compose(s.parse(t)));if(i&&n)for(const o of r)o.errors.forEach(ja(t,n)),o.warnings.forEach(ja(t,n));return r.length>0?r:Object.assign([],{empty:!0},l.streamInfo())}function aw(t,e={}){const{lineCounter:n,prettyErrors:i}=ow(e),s=new Kd(n?.addNewLine),l=new Wd(e);let r=null;for(const o of l.compose(s.parse(t),!0,t.length))if(!r)r=o;else if(r.options.logLevel!=="silent"){r.errors.push(new Ws(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(r.errors.forEach(ja(t,n)),r.warnings.forEach(ja(t,n))),r}function H8(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);const s=aw(t,n);if(!s)return null;if(s.warnings.forEach(l=>$v(s.options.logLevel,l)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:i},n))}function V8(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(t===void 0){const{keepUndefined:s}=n??e??{};if(!s)return}return new Lr(t,i,n).toString(n)}const ur=Object.freeze(Object.defineProperty({__proto__:null,Alias:Oc,CST:z8,Composer:Wd,Document:Lr,Lexer:sw,LineCounter:lw,Pair:dn,Parser:Kd,Scalar:xe,Schema:jc,YAMLError:Yd,YAMLMap:zn,YAMLParseError:Ws,YAMLSeq:Ps,YAMLWarning:Wv,isAlias:hl,isCollection:jt,isDocument:Sr,isMap:Tr,isNode:Ht,isPair:Ct,isScalar:Tt,isSeq:Er,parse:H8,parseAllDocuments:q8,parseDocument:aw,stringify:V8,visit:Ns,visitAsync:Ec},Symbol.toStringTag,{value:"Module"})),Cf=(t,e,{ellipsis:n="…"}={})=>{const i=[...t];return`${i.slice(0,e).join("").trim()}${i.length>e?n:""}`},Vt=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ci=t=>t.replace(/^\/+/,"").replace(/\/+$/,""),Ks=()=>window.crypto.randomUUID(),Gp=t=>t.match(/{{.+?}}/)?t:`{{${t}}}`,Zd=(t,e,n)=>{const i=e.value_field,s=e.display_fields,l=Gp(i),r=(s??[i]).map(Gp).join(" ");return n.map(o=>{const{content:a}=o?.locales[t]??{};if(!a)return;const c=Mi(a),u=Object.fromEntries([...new Set([...[...r.matchAll(/{{(.+?)}}/g)].map(_=>_[1]),...[...l.matchAll(/{{(.+?)}}/g)].map(_=>_[1])].map(_=>_.includes(".")?_.replace(/^([^.]+)+\.\*\.[^.]+$/,"$1.*"):_))].map(_=>{if(_.endsWith(".*")){const w=new RegExp(`^${Vt(_).replace("\\.\\*","\\.\\d+\\.[^.]+")}$`),k=ol(Object.fromEntries(Object.entries(c).filter(([T])=>!!T.match(w))));return[_,k[Object.keys(k)[0]]??""]}if(_==="slug")return[_,o.slug];const p=ri({collectionName:e.collection,keyPath:_}),b=_.replace(/^fields\./,""),g=c[b];return p?.widget==="relation"?[_,Xd({fieldConfig:p,valueMap:c,keyPath:b,locale:t})??""]:[_,g??""]})),f=Math.max(...Object.values(u).map(_=>Array.isArray(_)?_.length:1));let d=new Array(f).fill(r),h=new Array(f).fill(l);return Object.entries(u).forEach(([_,p])=>{Array.isArray(p)?p.forEach((b,g)=>{Object.entries(b).forEach(([w,k])=>{d.forEach((T,P)=>{g%P===0&&(d[g]=d[g].replaceAll(`{{${_}.${w}}}`,k),h[g]=h[g].replaceAll(`{{${_}.${w}}}`,k))})})}):(d=d.map(b=>b.replaceAll(`{{${_}}}`,p)),h=h.map(b=>b.replaceAll(`{{${_}}}`,p)))}),d.map((_,p)=>({label:_,value:h[p]}))}).flat(1).filter(Boolean).sort((o,a)=>o.label.localeCompare(a.label))},Xd=({fieldConfig:t,valueMap:e,keyPath:n,locale:i})=>{const{multiple:s,collection:l}=t,r=Co(l),o=Zd(i,t,r),a=c=>o.find(u=>u.value===c)?.label||c;return s?Object.entries(e).filter(([u])=>u.match(`^${Vt(n)}\\.\\d+$`)).map(([,u])=>u).map(a):a(e[n])},ji=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),cw=t=>Array.isArray(t)&&t.every(e=>ji(e)),uw=(t=1e3)=>new Promise(e=>{window.setTimeout(()=>{e()},t)}),Y8=({fieldConfig:t,valueMap:e,keyPath:n})=>{const{multiple:i,options:s}=t,l=cw(s),r=a=>s.find(c=>c.value===a)?.label||a;if(i){const a=Object.entries(e).filter(([c])=>c.match(`^${Vt(n)}\\.\\d+$`)).map(([,c])=>c);return l?a.map(r):a}const o=e[n];return l?r(o):o},ri=({collectionName:t,fileName:e=void 0,valueMap:n={},keyPath:i})=>{const s=yi(t),{fields:l}=e?s.files.find(({name:a})=>a===e):s,r=i.split(".");let o;return r.forEach((a,c)=>{if(c===0)o=l.find(({name:u})=>u===a);else if(o){const u=a.match(/^\d+$/),{field:f,fields:d,types:h,typeKey:_="type"}=o;f?o=f:d&&!u?o=d.find(({name:p})=>p===a):h&&u&&(o=h.find(({name:p})=>p===n[`${r.slice(0,c).join(".")}.${a}.${_}`]))}}),o},Jd=({collectionName:t,fileName:e,valueMap:n,keyPath:i,locale:s})=>{const l=ri({collectionName:t,fileName:e,valueMap:n,keyPath:i});let r=n[i];return l?.widget==="relation"&&(r=Xd({fieldConfig:l,valueMap:n,keyPath:i,locale:s})),l?.widget==="select"&&(r=Y8({fieldConfig:l,valueMap:n,keyPath:i})),r??""},fr=(t,e,n,{resolveRef:i=!0}={})=>{const{slug:s,locales:l,commitAuthor:{name:r,login:o,email:a}={},commitDate:c}=t;if(n==="slug")return s;if(n==="commit_author")return r||o||a;if(n==="commit_date")return c;const u=l[e]?.content;if(u===void 0)return;const f=n.includes(".")?Mi(u):u;if(i){const d=ri({collectionName:t.collectionName,keyPath:n});if(d?.widget==="relation")return Xd({fieldConfig:d,valueMap:f,keyPath:n,locale:e})}return f[n]},fo=Ge(!1),Qd=Ge([]),ni=Ge([]),Rt=Ge(),Ts=Ge([]),G8=t=>{const e=le(Ot);let n="single_file",i=[],s,l=!0;t?.i18n===!0&&ji(e?.i18n)&&({structure:n="single_file",locales:i=[],default_locale:s=void 0,save_all_locales:l=!0}=e.i18n),ji(t?.i18n)&&({structure:n="single_file",locales:i=[],default_locale:s=void 0,save_all_locales:l=!0}=t.i18n);const r=!!i.length;return{structure:n,hasLocales:r,locales:r?i:[],defaultLocale:r?s&&i.includes(s)?s:i[0]:void 0,saveAllLocales:l}},yi=t=>{const e=le(Ot).collections.find(n=>n.name===t);return{...e,_i18n:G8(e)}},xd=(t,e)=>le(ni).find(n=>n.collectionName===t&&n.fileName===e),Co=t=>{const e=yi(t);if(!e)return[];const{filter:n,_i18n:{defaultLocale:i="default"}}=e;return le(ni).filter(s=>s.collectionName===t&&(!n||fr(s,i,n.field)===n.value))},W8=async t=>{const e=t.replace(le(Ot).site_url,""),n=le(ni),i=await Promise.all(n.map(async s=>{const{locales:l,collectionName:r,fileName:o}=s;return(await Promise.all(Object.values(l).map(async({content:c})=>{const u=Mi(c);return(await Promise.all(Object.entries(u).map(async([d,h])=>{const _=ri({collectionName:r,fileName:o,valueMap:u,keyPath:d});return!_||!["image","file"].includes(_.widget)?!1:await rs(h,s)===e}))).includes(!0)}))).includes(!0)}));return n.filter((s,l)=>i[l])};var K8=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,s,l;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(s=i;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(l=Object.keys(e),i=l.length,i!==Object.keys(n).length)return!1;for(s=i;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,l[s]))return!1;for(s=i;s--!==0;){var r=l[s];if(!t(e[r],n[r]))return!1}return!0}return e!==e&&n!==n};const jn=Ed(K8);class sn{static async set(e,n){window.localStorage.setItem(e,JSON.stringify(n))}static async get(e){return JSON.parse(window.localStorage.getItem(e))}static async delete(e){window.localStorage.removeItem(e)}static async clear(){window.localStorage.clear()}static async keys(){return Object.keys(window.localStorage)}static async values(){return Object.values(window.localStorage).map(e=>JSON.parse(e))}static async entries(){return Object.entries(window.localStorage).map(([e,n])=>[e,JSON.parse(n)])}}const Df="sveltia-cms.prefs",vt=Ge({},t=>{(async()=>{try{const e=await sn.get(Df)??{};e.apiKeys||={},t(e)}catch{t({error:"permission_denied"})}})()});vt.subscribe(async t=>{if(!t||t.error||!Object.keys(t).length)return;try{jn(t,await sn.get(Df))||await sn.set(Df,t)}catch{}const{locale:e,theme:n,devModeEnabled:i=!1}=t;e&&le(J0).includes(e)&&xt.set(e);const s=!n||n==="auto",l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";Object.assign(document.documentElement.dataset,{theme:s?l:n,autoTheming:s,env:i?"dev":"prod"})});const Ot=Ge(),{DEV:Z8,VITE_SITE_URL:X8}={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1},J8=t=>{if(!ji(t))throw new Error(le(me)("config.error.parse_failed"));if(!t.collections?.length)throw new Error(le(me)("config.error.no_collection"));if(!t.backend?.name)throw new Error(le(me)("config.error.no_backend"));if(!(t.backend.name in $k))throw new Error(le(me)("config.error.unsupported_backend",{values:{name:t.backend.name}}));if(!t.media_folder)throw new Error(le(me)("config.error.no_media_folder"))},Q8=async()=>{const{href:t="./config.yml"}=document.querySelector('link[type="text/yaml"][rel="cms-config-url"]')??{};let e,n;try{try{e=await fetch(t)}catch{throw new Error(le(me)("config.error.fetch_failed"))}if(!e.ok)throw new Error(le(me)("config.error.fetch_failed"));try{n=ur.parse(await e.text())}catch{throw new Error(le(me)("config.error.parse_failed"))}J8(n),Z8&&!n.site_url&&(n.site_url=X8||"http://localhost:5174"),Ot.set(n)}catch(i){Ot.set({error:i.name==="Error"?i.message:le(me)("config.error.unexpected")}),console.error(i)}};Ot.subscribe(t=>{if(le(vt).devModeEnabled&&console.info("siteConfig",t),!t||t.error)return;const{media_folder:e,public_folder:n,collections:i}=t;Rt.set(yi(i[0].name));const s=[...i.filter(({folder:u})=>!!u).map(({name:u,folder:f,extension:d,format:h,frontmatter_delimiter:_,yaml_quote:p})=>({collectionName:u,folder:f,extension:d,format:h,frontmatterDelimiter:_,yamlQuote:p})).sort((u,f)=>u.folder.localeCompare(f.folder)),...i.filter(({files:u})=>!!u).map(({name:u,files:f,extension:d,format:h,frontmatter_delimiter:_,yaml_quote:p})=>f.map(({name:b,file:g})=>({collectionName:u,fileName:b,file:g,extension:d,format:h,frontmatterDelimiter:_,yamlQuote:p}))).flat(1).sort((u,f)=>u.file.localeCompare(f.file))],l=Ci(e),r=n?`/${Ci(n)}`:`/${l}`,o={collectionName:null,internalPath:l,publicPath:r,entryRelative:!1},a=i.map(u=>{const{name:f,folder:d,path:h}=u;let{media_folder:_="",public_folder:p=""}=u;if(!h&&!_)return null;const b=!(_&&(_.startsWith("/")||_.includes("{{media_folder}}")));return _=_.replace("{{media_folder}}",l),p=p.replace("{{public_folder}}",r),{collectionName:f,internalPath:Ci(b?d:_),publicPath:p,entryRelative:b}}),c=[o,...a.filter(Boolean).sort((u,f)=>u.internalPath.localeCompare(f.internalPath))];Qd.set(s),_i.set(c),le(vt).devModeEnabled&&(console.info("allContentPaths",s),console.info("allAssetPaths",c))});const Bc=({date:t=new Date,timeZone:e=void 0}={})=>{const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"longOffset"};return Object.fromEntries(new Intl.DateTimeFormat("en-US",{...n,hour12:!1,timeZone:e}).formatToParts(t).filter(({type:i})=>i in n).map(({type:i,value:s})=>[i,i==="hour"&&s==="24"?"00":s]))},x8=async({items:t},{accept:e}={})=>{const n=e?e.trim().split(/,\s*/g):[],i=s=>new Promise(l=>{s.name.startsWith(".")?l(null):s.isFile?s.file(r=>{const o=!n.length||n.some(a=>{const[c,u]=a.split("/");return u==="*"?r.type.split("/")[0]===c:r.type===a});l(o?r:null)},()=>{l(null)}):s.createReader().readEntries(r=>{l(Promise.all(r.map(i)))})});return(await Promise.all([...t].map(s=>i(s.webkitGetAsEntry())))).flat(1e5).filter(Boolean).sort((s,l)=>s.name.localeCompare(l.name))},eO=async t=>{const e=new FileReader;return new Promise(n=>{e.onload=()=>{n(e.result)},e.readAsText(t)})},tO=async t=>{const e=new FileReader;return new Promise(n=>{e.onload=()=>{n(e.result)},e.readAsArrayBuffer(t)})},Fa=async t=>{const e=await window.crypto.subtle.digest("SHA-1",await tO(t));return Array.from(new Uint8Array(e)).map(n=>n.toString(16).padStart(2,"0")).join("")},fw=async t=>{const e=typeof t=="string"?new Blob([t],{type:"text/plain"}):t,n=new FileReader;return new Promise(i=>{n.onload=()=>{i(n.result)},n.readAsDataURL(e)})},nO=async t=>(await fw(t)).split(",")[1],dr=t=>{const e=new Intl.NumberFormat(le(xt)),n=1e3,i=n*1e3,s=i*1e3,l=s*1e3;return t<n?`${e.format(t)} bytes`:t<i?`${e.format(Number((t/n).toFixed(1)))} KB`:t<s?`${e.format(Number((t/i).toFixed(1)))} MB`:t<l?`${e.format(Number((t/s).toFixed(1)))} GB`:`${e.format(Number((t/l).toFixed(1)))} TB`},eh=(t,e)=>{if(!e.length)return t;const[,n,i]=t.match(/(.+?)(?:\.([a-zA-Z0-9]+?))?$/),s=new RegExp(`^${Vt(n)}(?:-(\\d+?))?${i?`\\.${i}`:""}$`),l=e.sort((r,o)=>r.split(".")[0].localeCompare(o.split(".")[0])).findLast(r=>r.match(s));return l?`${n}-${Number(l.match(s)[1]??0)+1}${i?`.${i}`:""}`:t},Mf=t=>{const e=t.split("/");return e.forEach((n,i)=>{if(n===".."){const s=e.findLastIndex((l,r)=>!!l&&r<i);s>-1&&(e[s]=null)}(n===".."||n===".")&&(e[i]=null)}),e.filter(Boolean).join("/")},dw=t=>{const{slug:{encoding:e="unicode",clean_accents:n=!1,sanitize_replacement:i="-"}={}}=le(Ot);let s=t;return n&&(s=s.normalize("NFD").replace(/\p{Diacritic}/gu,"")),e==="ascii"?s=s.replaceAll(/[^\w-~]/g," "):s=s.replaceAll(/[^\p{L}\p{N}]/gu," "),s.toLocaleLowerCase().trim().replaceAll(/\s+/g,i)},ho=(t,{collection:e,content:n,currentSlug:i="",isMediaFolder:s=!1,entryFilePath:l=""})=>{const{name:r,identifier_field:o="title",folder:a}=e,c=Bc(),u=t.replaceAll(/{{(.+?)}}/g,(f,d)=>{if(["year","month","day","hour","minute","second"].includes(d))return c[d];if(d==="slug"&&i)return i;if(d==="uuid")return Ks();if(d==="uuid_short")return Ks().split("-").pop();if(d==="uuid_shorter")return Ks().split("-").shift();if(s){if(!l)return"";if(d==="dirname")return l.replace(a,"").split("/").slice(0,-1).join("/");if(d==="filename")return l.split("/").pop().split(".").shift();if(d==="extension")return l.split("/").pop().split(".").pop()}let h;return d.startsWith("fields.")?h=n[d.replace(/^fields\./,"")]:d==="slug"?h=n[o]||n.title||n.name||n.label:h=n[d],h&&(h=dw(h)),h||Ks().split("-").pop()});return i?u:eh(u,Co(r).map(f=>f.slug))},iO=(t,e)=>{const n=e==="image",i=n?new Image:document.createElement(e);return new Promise(s=>{const l=()=>{s({dimensions:e==="audio"?void 0:{width:n?i.naturalWidth:i.videoWidth,height:n?i.naturalHeight:i.videoHeight},duration:n?void 0:i.duration})};i.addEventListener(n?"load":"loadedmetadata",l,{once:!0}),i.src=t})},Wp=t=>new Date(t*1e3).toISOString().substr(11,8),Kp=["image","video","audio","document","other"],jf={image:/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|tiff?|webp)$/i,video:/\.(?:avi|mp4|mpeg|ogv|ts|webm|3gp|3g2)$/i,audio:/\.(?:aac|midi?|mp3|opus|wav|weba)$/i,document:/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xslx?)$/i},an=Ge([]),_i=Ge([]),mi=Ge(),xs=Ge([]),Rf=Ge(),el=Ge(),Bn=Ge({folder:void 0,files:[]}),sO=pn([Bn],([t],e)=>{e(!!t.files?.length)}),lO=(t,e)=>{const{entryRelative:n,internalPath:i,publicPath:s}=le(_i).findLast(l=>[null,t.name].includes(l.collectionName));if(n){const l=t.path?t.path.split("/").slice(0,-1).join("/"):".";return{internalAssetFolder:Mf(ho(`${i}/${l}`,e)),publicAssetFolder:s.match(/^\.?$/)?s:Mf(ho(s,e))}}return{internalAssetFolder:i,publicAssetFolder:s}},th=t=>Object.entries(jf).find(([,e])=>t.match(e))?.[0]??"other",rO=(t,e)=>{if(!t.startsWith("/")){if(!e)return;const{collectionName:l,locales:r}=e,o=yi(l),{_i18n:{defaultLocale:a="default"},public_folder:c}=o,u=a in r?a:Object.keys(r)[0],{path:f,content:d}=r[u];if(!f||!d)return;const h=f.split("/").slice(0,-1).join("/"),_=c?ho(c,{collection:o,content:Mi(d),currentSlug:e.slug,isMediaFolder:!0,entryFilePath:f}):".",p=Mf(`${h}/${_}/${t}`);return le(an).find(b=>b.path===p)}const[,n,i]=t.match(/(.+?)\/([^/]+)$/)??[];if(!n)return;const{internalPath:s}=le(_i).findLast(l=>l.publicPath===n)??{};if(s)return le(an).find(l=>l.path===`${s}/${i}`)},mo=async(t,{pathOnly:e=!1}={})=>{if(!t)return;const n=t.url?.startsWith("blob:");if(n&&!e)return t.url;if(!t.url&&(t.file||t.fetchURL)&&!e){const o=URL.createObjectURL(t.file||await le(bi).fetchBlob(t));return an.update(a=>[...a.filter(({sha:c,path:u})=>!(c===t.sha&&u===t.path)),{...t,url:o}]),o}const{publicPath:i,entryRelative:s}=le(_i).find(({collectionName:o})=>o===t.collectionName)||le(_i).find(({collectionName:o})=>o===null);if(s)return n?t.url:void 0;const l=e?"":le(Ot).site_url??"",r=t.path.replace(t.folder,i);return`${l}${r}`},rs=async(t,e)=>{if(t)return t.match(/^(?:https?|data):/)?t:mo(rO(t,e))},oO=async t=>{const{kind:e}=t,n=await mo(t);let i,s;return["image","video","audio"].includes(e)&&n&&({dimensions:i,duration:s}=await iO(n,e)),{displayURL:n,dimensions:i,duration:s,usedEntries:await W8(n)}},aO=async t=>{const{site_domain:e=document.domain,base_url:n="https://api.netlify.com",auth_endpoint:i="auth"}=le(Ot).backend,s=600,l=800,{availHeight:r,availWidth:o}=window.screen,a=r/2-l/2,c=o/2-s/2,u=window.open(`${n}/${i}?provider=${t}&site_id=${e}&scope=repo`,"auth",`width=${s},height=${l},top=${a},left=${c}`);return new Promise(f=>{const d=({origin:h,data:_})=>{if(h!==n||typeof _!="string")return;if(_===`authorizing:${t}`){u.postMessage(_,h);return}const[,p,b]=_.match(`^authorization:${t}:(success|error):(.+)`)??[];let g;try{g=b?JSON.parse(b):void 0}catch{}f(p==="success"&&ji(g)&&typeof g.token=="string"?g.token:null),window.removeEventListener("message",d),u.close()};window.addEventListener("message",d)})},cO={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},uO=(t,{commitType:e="update",collection:n}={})=>{const{login:i="",name:s=""}=le(Fi),[l=""]=t.map(f=>f.slug).filter(Boolean),[r,...o]=t.map(({path:f})=>f),{backend:{commit_messages:a={}}={}}=le(Ot),c=n?.label_singular||n?.label||n?.name||"";let u=a[e]||cO[e]||"";return["create","update","delete"].includes(e)&&(u=u.replaceAll("{{slug}}",l).replaceAll("{{collection}}",c).replaceAll("{{path}}",r).replaceAll("{{author-login}}",i).replaceAll("{{author-name}}",s)),["uploadMedia","deleteMedia"].includes(e)&&(u=u.replaceAll("{{path}}",r).replaceAll("{{author-login}}",i).replaceAll("{{author-name}}",s),o.length&&(u+=` +${o.length}`)),["openAuthoring"].includes(e)&&(u=u.replaceAll("{{message}}",e).replaceAll("{{author-login}}",i).replaceAll("{{author-name}}",s)),u},fO="1.38.0",Me=SyntaxError,Qt=RangeError,Qe=TypeError,on=Error,Tn=void 0,os=typeof BigInt>"u"?Tn:BigInt,nh=RegExp,ih=WeakMap,hw=WeakMap.prototype.get,mw=WeakMap.prototype.set,Hn=Object.create,Hl=Number.isSafeInteger,Wi=Object.getOwnPropertyNames,Yn=Object.freeze,pw=Object.prototype.isPrototypeOf,Dn=Object.seal?Object.preventExtensions(Object.create(null)):null,hr=Function.prototype.bind,Zp=RegExp.prototype.test,Xp=RegExp.prototype.exec,sh=Reflect.apply,Ff=Proxy,Jp=typeof Symbol>"u"?Tn:Symbol.toStringTag,gw=Object.defineProperty,Es=Object.assign,lh=Object,dO=Math.floor,tl=Array.isArray,mr=1/0,rh=String.fromCharCode,za=Array,ia=Object.prototype.hasOwnProperty,Qp=Object.prototype.propertyIsEnumerable,Is=Function.prototype.apply;var _w=Qp.call.bind(Qp),ms=lh.hasOwn||function(){return ia.bind?ia.call.bind(ia):function(e,n){return ia.call(e,n)}}(),bw=lh.create;function xp(t){var e=bw(Dn);return ms(t,"value")&&(e.value=t.value),ms(t,"writable")&&(e.writable=t.writable),ms(t,"get")&&(e.get=t.get),ms(t,"set")&&(e.set=t.set),ms(t,"enumerable")&&(e.enumerable=t.enumerable),ms(t,"configurable")&&(e.configurable=t.configurable),e}const hO=function(e,n){if(!n&&typeof e!="function"&&(n=e,e=Hn(Dn)),Es)Es(e,n);else for(var i in n)ms(n,i)&&(e[i]=n[i]);if(e.default=e,typeof e=="function")e.prototype&&Yn(e.prototype);else if(Jp){var s=Hn(Dn);s.value="Module",gw(e,Jp,s)}return Yn(e)};/*!@preserve@license
223
+ `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=na(e),i=$l(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i}]}}case"map-value-ind":{this.onKeyLine=!0;const n=na(e),i=$l(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function ow(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new lw||null,prettyErrors:e}}function q8(t,e={}){const{lineCounter:n,prettyErrors:i}=ow(e),s=new Kd(n?.addNewLine),l=new Wd(e),r=Array.from(l.compose(s.parse(t)));if(i&&n)for(const o of r)o.errors.forEach(ja(t,n)),o.warnings.forEach(ja(t,n));return r.length>0?r:Object.assign([],{empty:!0},l.streamInfo())}function aw(t,e={}){const{lineCounter:n,prettyErrors:i}=ow(e),s=new Kd(n?.addNewLine),l=new Wd(e);let r=null;for(const o of l.compose(s.parse(t),!0,t.length))if(!r)r=o;else if(r.options.logLevel!=="silent"){r.errors.push(new Ws(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(r.errors.forEach(ja(t,n)),r.warnings.forEach(ja(t,n))),r}function H8(t,e,n){let i;typeof e=="function"?i=e:n===void 0&&e&&typeof e=="object"&&(n=e);const s=aw(t,n);if(!s)return null;if(s.warnings.forEach(l=>$v(s.options.logLevel,l)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:i},n))}function V8(t,e,n){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(t===void 0){const{keepUndefined:s}=n??e??{};if(!s)return}return new Lr(t,i,n).toString(n)}const ur=Object.freeze(Object.defineProperty({__proto__:null,Alias:Oc,CST:z8,Composer:Wd,Document:Lr,Lexer:sw,LineCounter:lw,Pair:dn,Parser:Kd,Scalar:xe,Schema:jc,YAMLError:Yd,YAMLMap:zn,YAMLParseError:Ws,YAMLSeq:Ps,YAMLWarning:Wv,isAlias:hl,isCollection:jt,isDocument:Sr,isMap:Tr,isNode:Ht,isPair:Ct,isScalar:Tt,isSeq:Er,parse:H8,parseAllDocuments:q8,parseDocument:aw,stringify:V8,visit:Ns,visitAsync:Ec},Symbol.toStringTag,{value:"Module"})),Cf=(t,e,{ellipsis:n="…"}={})=>{const i=[...t];return`${i.slice(0,e).join("").trim()}${i.length>e?n:""}`},Vt=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ci=t=>t.replace(/^\/+/,"").replace(/\/+$/,""),Ks=()=>window.crypto.randomUUID(),Gp=t=>t.match(/{{.+?}}/)?t:`{{${t}}}`,Zd=(t,e,n)=>{const i=e.value_field,s=e.display_fields,l=Gp(i),r=(s??[i]).map(Gp).join(" ");return n.map(o=>{const{content:a}=o?.locales[t]??{};if(!a)return;const c=Mi(a),u=Object.fromEntries([...new Set([...[...r.matchAll(/{{(.+?)}}/g)].map(_=>_[1]),...[...l.matchAll(/{{(.+?)}}/g)].map(_=>_[1])].map(_=>_.includes(".")?_.replace(/^([^.]+)+\.\*\.[^.]+$/,"$1.*"):_))].map(_=>{if(_.endsWith(".*")){const w=new RegExp(`^${Vt(_).replace("\\.\\*","\\.\\d+\\.[^.]+")}$`),k=ol(Object.fromEntries(Object.entries(c).filter(([T])=>!!T.match(w))));return[_,k[Object.keys(k)[0]]??""]}if(_==="slug")return[_,o.slug];const p=ri({collectionName:e.collection,keyPath:_}),b=_.replace(/^fields\./,""),g=c[b];return p?.widget==="relation"?[_,Xd({fieldConfig:p,valueMap:c,keyPath:b,locale:t})??""]:[_,g??""]})),f=Math.max(...Object.values(u).map(_=>Array.isArray(_)?_.length:1));let d=new Array(f).fill(r),h=new Array(f).fill(l);return Object.entries(u).forEach(([_,p])=>{Array.isArray(p)?p.forEach((b,g)=>{Object.entries(b).forEach(([w,k])=>{d.forEach((T,P)=>{g%P===0&&(d[g]=d[g].replaceAll(`{{${_}.${w}}}`,k),h[g]=h[g].replaceAll(`{{${_}.${w}}}`,k))})})}):(d=d.map(b=>b.replaceAll(`{{${_}}}`,p)),h=h.map(b=>b.replaceAll(`{{${_}}}`,p)))}),d.map((_,p)=>({label:_,value:h[p]}))}).flat(1).filter(Boolean).sort((o,a)=>o.label.localeCompare(a.label))},Xd=({fieldConfig:t,valueMap:e,keyPath:n,locale:i})=>{const{multiple:s,collection:l}=t,r=Co(l),o=Zd(i,t,r),a=c=>o.find(u=>u.value===c)?.label||c;return s?Object.entries(e).filter(([u])=>u.match(`^${Vt(n)}\\.\\d+$`)).map(([,u])=>u).map(a):a(e[n])},ji=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),cw=t=>Array.isArray(t)&&t.every(e=>ji(e)),uw=(t=1e3)=>new Promise(e=>{window.setTimeout(()=>{e()},t)}),Y8=({fieldConfig:t,valueMap:e,keyPath:n})=>{const{multiple:i,options:s}=t,l=cw(s),r=a=>s.find(c=>c.value===a)?.label||a;if(i){const a=Object.entries(e).filter(([c])=>c.match(`^${Vt(n)}\\.\\d+$`)).map(([,c])=>c);return l?a.map(r):a}const o=e[n];return l?r(o):o},ri=({collectionName:t,fileName:e=void 0,valueMap:n={},keyPath:i})=>{const s=yi(t),{fields:l}=e?s.files.find(({name:a})=>a===e):s,r=i.split(".");let o;return r.forEach((a,c)=>{if(c===0)o=l.find(({name:u})=>u===a);else if(o){const u=a.match(/^\d+$/),{field:f,fields:d,types:h,typeKey:_="type"}=o;f?o=f:d&&!u?o=d.find(({name:p})=>p===a):h&&u&&(o=h.find(({name:p})=>p===n[`${r.slice(0,c).join(".")}.${a}.${_}`]))}}),o},Jd=({collectionName:t,fileName:e,valueMap:n,keyPath:i,locale:s})=>{const l=ri({collectionName:t,fileName:e,valueMap:n,keyPath:i});let r=n[i];return l?.widget==="relation"&&(r=Xd({fieldConfig:l,valueMap:n,keyPath:i,locale:s})),l?.widget==="select"&&(r=Y8({fieldConfig:l,valueMap:n,keyPath:i})),r??""},fr=(t,e,n,{resolveRef:i=!0}={})=>{const{slug:s,locales:l,commitAuthor:{name:r,login:o,email:a}={},commitDate:c}=t;if(n==="slug")return s;if(n==="commit_author")return r||o||a;if(n==="commit_date")return c;const u=l[e]?.content;if(u===void 0)return;const f=n.includes(".")?Mi(u):u;if(i){const d=ri({collectionName:t.collectionName,keyPath:n});if(d?.widget==="relation")return Xd({fieldConfig:d,valueMap:f,keyPath:n,locale:e})}return f[n]},fo=Ge(!1),Qd=Ge([]),ni=Ge([]),Rt=Ge(),Ts=Ge([]),G8=t=>{const e=le(Ot);let n="single_file",i=[],s,l=!0;t?.i18n===!0&&ji(e?.i18n)&&({structure:n="single_file",locales:i=[],default_locale:s=void 0,save_all_locales:l=!0}=e.i18n),ji(t?.i18n)&&({structure:n="single_file",locales:i=[],default_locale:s=void 0,save_all_locales:l=!0}=t.i18n);const r=!!i.length;return{structure:n,hasLocales:r,locales:r?i:[],defaultLocale:r?s&&i.includes(s)?s:i[0]:void 0,saveAllLocales:l}},yi=t=>{const e=le(Ot).collections.find(n=>n.name===t);return{...e,_i18n:G8(e)}},xd=(t,e)=>le(ni).find(n=>n.collectionName===t&&n.fileName===e),Co=t=>{const e=yi(t);if(!e)return[];const{filter:n,_i18n:{defaultLocale:i="default"}}=e;return le(ni).filter(s=>s.collectionName===t&&(!n||fr(s,i,n.field)===n.value))},W8=async t=>{const e=t.replace(le(Ot).site_url,""),n=le(ni),i=await Promise.all(n.map(async s=>{const{locales:l,collectionName:r,fileName:o}=s;return(await Promise.all(Object.values(l).map(async({content:c})=>{const u=Mi(c);return(await Promise.all(Object.entries(u).map(async([d,h])=>{const _=ri({collectionName:r,fileName:o,valueMap:u,keyPath:d});return!_||!["image","file"].includes(_.widget)?!1:await rs(h,s)===e}))).includes(!0)}))).includes(!0)}));return n.filter((s,l)=>i[l])};var K8=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,s,l;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(s=i;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(l=Object.keys(e),i=l.length,i!==Object.keys(n).length)return!1;for(s=i;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,l[s]))return!1;for(s=i;s--!==0;){var r=l[s];if(!t(e[r],n[r]))return!1}return!0}return e!==e&&n!==n};const jn=Ed(K8);class sn{static async set(e,n){window.localStorage.setItem(e,JSON.stringify(n))}static async get(e){return JSON.parse(window.localStorage.getItem(e))}static async delete(e){window.localStorage.removeItem(e)}static async clear(){window.localStorage.clear()}static async keys(){return Object.keys(window.localStorage)}static async values(){return Object.values(window.localStorage).map(e=>JSON.parse(e))}static async entries(){return Object.entries(window.localStorage).map(([e,n])=>[e,JSON.parse(n)])}}const Df="sveltia-cms.prefs",vt=Ge({},t=>{(async()=>{try{const e=await sn.get(Df)??{};e.apiKeys||={},t(e)}catch{t({error:"permission_denied"})}})()});vt.subscribe(async t=>{if(!t||t.error||!Object.keys(t).length)return;try{jn(t,await sn.get(Df))||await sn.set(Df,t)}catch{}const{locale:e,theme:n,devModeEnabled:i=!1}=t;e&&le(J0).includes(e)&&xt.set(e);const s=!n||n==="auto",l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";Object.assign(document.documentElement.dataset,{theme:s?l:n,autoTheming:s,env:i?"dev":"prod"})});const Ot=Ge(),{DEV:Z8,VITE_SITE_URL:X8}={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1},J8=t=>{if(!ji(t))throw new Error(le(me)("config.error.parse_failed"));if(!t.collections?.length)throw new Error(le(me)("config.error.no_collection"));if(!t.backend?.name)throw new Error(le(me)("config.error.no_backend"));if(!(t.backend.name in $k))throw new Error(le(me)("config.error.unsupported_backend",{values:{name:t.backend.name}}));if(!t.media_folder)throw new Error(le(me)("config.error.no_media_folder"))},Q8=async()=>{const{href:t="./config.yml"}=document.querySelector('link[type="text/yaml"][rel="cms-config-url"]')??{};let e,n;try{try{e=await fetch(t)}catch{throw new Error(le(me)("config.error.fetch_failed"))}if(!e.ok)throw new Error(le(me)("config.error.fetch_failed"));try{n=ur.parse(await e.text())}catch{throw new Error(le(me)("config.error.parse_failed"))}J8(n),Z8&&!n.site_url&&(n.site_url=X8||"http://localhost:5174"),Ot.set(n)}catch(i){Ot.set({error:i.name==="Error"?i.message:le(me)("config.error.unexpected")}),console.error(i)}};Ot.subscribe(t=>{if(le(vt).devModeEnabled&&console.info("siteConfig",t),!t||t.error)return;const{media_folder:e,public_folder:n,collections:i}=t;Rt.set(yi(i[0].name));const s=[...i.filter(({folder:u})=>!!u).map(({name:u,folder:f,extension:d,format:h,frontmatter_delimiter:_,yaml_quote:p})=>({collectionName:u,folder:f,extension:d,format:h,frontmatterDelimiter:_,yamlQuote:p})).sort((u,f)=>u.folder.localeCompare(f.folder)),...i.filter(({files:u})=>!!u).map(({name:u,files:f,extension:d,format:h,frontmatter_delimiter:_,yaml_quote:p})=>f.map(({name:b,file:g})=>({collectionName:u,fileName:b,file:g,extension:d,format:h,frontmatterDelimiter:_,yamlQuote:p}))).flat(1).sort((u,f)=>u.file.localeCompare(f.file))],l=Ci(e),r=n?`/${Ci(n)}`.replace(/^\/@/,"@"):`/${l}`,o={collectionName:null,internalPath:l,publicPath:r,entryRelative:!1},a=i.map(u=>{const{name:f,folder:d,path:h}=u;let{media_folder:_="",public_folder:p=""}=u;if(!h&&!_)return null;const b=!(_&&(_.startsWith("/")||_.includes("{{media_folder}}")));return _=_.replace("{{media_folder}}",l),p=p.replace("{{public_folder}}",r),{collectionName:f,internalPath:Ci(b?d:_),publicPath:p,entryRelative:b}}),c=[o,...a.filter(Boolean).sort((u,f)=>u.internalPath.localeCompare(f.internalPath))];Qd.set(s),_i.set(c),le(vt).devModeEnabled&&(console.info("allContentPaths",s),console.info("allAssetPaths",c))});const Bc=({date:t=new Date,timeZone:e=void 0}={})=>{const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"longOffset"};return Object.fromEntries(new Intl.DateTimeFormat("en-US",{...n,hour12:!1,timeZone:e}).formatToParts(t).filter(({type:i})=>i in n).map(({type:i,value:s})=>[i,i==="hour"&&s==="24"?"00":s]))},x8=async({items:t},{accept:e}={})=>{const n=e?e.trim().split(/,\s*/g):[],i=s=>new Promise(l=>{s.name.startsWith(".")?l(null):s.isFile?s.file(r=>{const o=!n.length||n.some(a=>{const[c,u]=a.split("/");return u==="*"?r.type.split("/")[0]===c:r.type===a});l(o?r:null)},()=>{l(null)}):s.createReader().readEntries(r=>{l(Promise.all(r.map(i)))})});return(await Promise.all([...t].map(s=>i(s.webkitGetAsEntry())))).flat(1e5).filter(Boolean).sort((s,l)=>s.name.localeCompare(l.name))},eO=async t=>{const e=new FileReader;return new Promise(n=>{e.onload=()=>{n(e.result.replace(/\r\n/g,`
224
+ `))},e.readAsText(t)})},tO=async t=>{const e=new FileReader;return new Promise(n=>{e.onload=()=>{n(e.result)},e.readAsArrayBuffer(t)})},Fa=async t=>{const e=await window.crypto.subtle.digest("SHA-1",await tO(t));return Array.from(new Uint8Array(e)).map(n=>n.toString(16).padStart(2,"0")).join("")},fw=async t=>{const e=typeof t=="string"?new Blob([t],{type:"text/plain"}):t,n=new FileReader;return new Promise(i=>{n.onload=()=>{i(n.result)},n.readAsDataURL(e)})},nO=async t=>(await fw(t)).split(",")[1],dr=t=>{const e=new Intl.NumberFormat(le(xt)),n=1e3,i=n*1e3,s=i*1e3,l=s*1e3;return t<n?`${e.format(t)} bytes`:t<i?`${e.format(Number((t/n).toFixed(1)))} KB`:t<s?`${e.format(Number((t/i).toFixed(1)))} MB`:t<l?`${e.format(Number((t/s).toFixed(1)))} GB`:`${e.format(Number((t/l).toFixed(1)))} TB`},eh=(t,e)=>{if(!e.length)return t;const[,n,i]=t.match(/(.+?)(?:\.([a-zA-Z0-9]+?))?$/),s=new RegExp(`^${Vt(n)}(?:-(\\d+?))?${i?`\\.${i}`:""}$`),l=e.sort((r,o)=>r.split(".")[0].localeCompare(o.split(".")[0])).findLast(r=>r.match(s));return l?`${n}-${Number(l.match(s)[1]??0)+1}${i?`.${i}`:""}`:t},Mf=t=>{const e=t.split("/");return e.forEach((n,i)=>{if(n===".."){const s=e.findLastIndex((l,r)=>!!l&&r<i);s>-1&&(e[s]=null)}(n===".."||n===".")&&(e[i]=null)}),e.filter(Boolean).join("/")},dw=t=>{const{slug:{encoding:e="unicode",clean_accents:n=!1,sanitize_replacement:i="-"}={}}=le(Ot);let s=t;return n&&(s=s.normalize("NFD").replace(/\p{Diacritic}/gu,"")),e==="ascii"?s=s.replaceAll(/[^\w-~]/g," "):s=s.replaceAll(/[^\p{L}\p{N}]/gu," "),s.toLocaleLowerCase().trim().replaceAll(/\s+/g,i)},ho=(t,{collection:e,content:n,currentSlug:i="",isMediaFolder:s=!1,entryFilePath:l=""})=>{const{name:r,identifier_field:o="title",folder:a}=e,c=Bc(),u=t.replaceAll(/{{(.+?)}}/g,(f,d)=>{if(["year","month","day","hour","minute","second"].includes(d))return c[d];if(d==="slug"&&i)return i;if(d==="uuid")return Ks();if(d==="uuid_short")return Ks().split("-").pop();if(d==="uuid_shorter")return Ks().split("-").shift();if(s){if(!l)return"";if(d==="dirname")return l.replace(a,"").split("/").slice(0,-1).join("/");if(d==="filename")return l.split("/").pop().split(".").shift();if(d==="extension")return l.split("/").pop().split(".").pop()}let h;return d.startsWith("fields.")?h=n[d.replace(/^fields\./,"")]:d==="slug"?h=n[o]||n.title||n.name||n.label:h=n[d],h&&(h=dw(h)),h||Ks().split("-").pop()});return i?u:eh(u,Co(r).map(f=>f.slug))},iO=(t,e)=>{const n=e==="image",i=n?new Image:document.createElement(e);return new Promise(s=>{const l=()=>{s({dimensions:e==="audio"?void 0:{width:n?i.naturalWidth:i.videoWidth,height:n?i.naturalHeight:i.videoHeight},duration:n?void 0:i.duration})};i.addEventListener(n?"load":"loadedmetadata",l,{once:!0}),i.src=t})},Wp=t=>new Date(t*1e3).toISOString().substr(11,8),Kp=["image","video","audio","document","other"],jf={image:/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|tiff?|webp)$/i,video:/\.(?:avi|mp4|mpeg|ogv|ts|webm|3gp|3g2)$/i,audio:/\.(?:aac|midi?|mp3|opus|wav|weba)$/i,document:/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xslx?)$/i},an=Ge([]),_i=Ge([]),mi=Ge(),xs=Ge([]),Rf=Ge(),el=Ge(),Bn=Ge({folder:void 0,files:[]}),sO=pn([Bn],([t],e)=>{e(!!t.files?.length)}),lO=(t,e)=>{const{entryRelative:n,internalPath:i,publicPath:s}=le(_i).findLast(l=>[null,t.name].includes(l.collectionName));if(n){const l=t.path?t.path.split("/").slice(0,-1).join("/"):".";return{internalAssetFolder:Mf(ho(`${i}/${l}`,e)),publicAssetFolder:s.match(/^\.?$/)?s:Mf(ho(s,e))}}return{internalAssetFolder:i,publicAssetFolder:s}},th=t=>Object.entries(jf).find(([,e])=>t.match(e))?.[0]??"other",rO=(t,e)=>{if(!t.match(/^[/@]/)){if(!e)return;const{collectionName:l,locales:r}=e,o=yi(l),{_i18n:{defaultLocale:a="default"},public_folder:c}=o,u=a in r?a:Object.keys(r)[0],{path:f,content:d}=r[u];if(!f||!d)return;const h=f.split("/").slice(0,-1).join("/"),_=c?ho(c,{collection:o,content:Mi(d),currentSlug:e.slug,isMediaFolder:!0,entryFilePath:f}):".",p=Mf(`${h}/${_}/${t}`);return le(an).find(b=>b.path===p)}const[,n,i]=t.match(/(.+?)\/([^/]+)$/)??[];if(!n)return;const{internalPath:s}=le(_i).findLast(l=>l.publicPath===n)??{};if(s)return le(an).find(l=>l.path===`${s}/${i}`)},mo=async(t,{pathOnly:e=!1}={})=>{if(!t)return;const n=t.url?.startsWith("blob:");if(n&&!e)return t.url;if(!t.url&&(t.file||t.fetchURL)&&!e){const o=URL.createObjectURL(t.file||await le(bi).fetchBlob(t));return an.update(a=>[...a.filter(({sha:c,path:u})=>!(c===t.sha&&u===t.path)),{...t,url:o}]),o}const{publicPath:i,entryRelative:s}=le(_i).find(({collectionName:o})=>o===t.collectionName)||le(_i).find(({collectionName:o})=>o===null);if(s)return n?t.url:void 0;const l=e?"":le(Ot).site_url??"",r=t.path.replace(t.folder,i);return`${l}${r}`},rs=async(t,e)=>{if(t)return t.match(/^(?:https?|data):/)?t:mo(rO(t,e))},oO=async t=>{const{kind:e}=t,n=await mo(t);let i,s;return["image","video","audio"].includes(e)&&n&&({dimensions:i,duration:s}=await iO(n,e)),{displayURL:n,dimensions:i,duration:s,usedEntries:await W8(n)}},aO=async t=>{const{site_domain:e=document.domain,base_url:n="https://api.netlify.com",auth_endpoint:i="auth"}=le(Ot).backend,s=600,l=800,{availHeight:r,availWidth:o}=window.screen,a=r/2-l/2,c=o/2-s/2,u=window.open(`${n}/${i}?provider=${t}&site_id=${e}&scope=repo`,"auth",`width=${s},height=${l},top=${a},left=${c}`);return new Promise(f=>{const d=({origin:h,data:_})=>{if(h!==n||typeof _!="string")return;if(_===`authorizing:${t}`){u.postMessage(_,h);return}const[,p,b]=_.match(`^authorization:${t}:(success|error):(.+)`)??[];let g;try{g=b?JSON.parse(b):void 0}catch{}f(p==="success"&&ji(g)&&typeof g.token=="string"?g.token:null),window.removeEventListener("message",d),u.close()};window.addEventListener("message",d)})},cO={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},uO=(t,{commitType:e="update",collection:n}={})=>{const{login:i="",name:s=""}=le(Fi),[l=""]=t.map(f=>f.slug).filter(Boolean),[r,...o]=t.map(({path:f})=>f),{backend:{commit_messages:a={}}={}}=le(Ot),c=n?.label_singular||n?.label||n?.name||"";let u=a[e]||cO[e]||"";return["create","update","delete"].includes(e)&&(u=u.replaceAll("{{slug}}",l).replaceAll("{{collection}}",c).replaceAll("{{path}}",r).replaceAll("{{author-login}}",i).replaceAll("{{author-name}}",s)),["uploadMedia","deleteMedia"].includes(e)&&(u=u.replaceAll("{{path}}",r).replaceAll("{{author-login}}",i).replaceAll("{{author-name}}",s),o.length&&(u+=` +${o.length}`)),["openAuthoring"].includes(e)&&(u=u.replaceAll("{{message}}",e).replaceAll("{{author-login}}",i).replaceAll("{{author-name}}",s)),u},fO="1.38.0",Me=SyntaxError,Qt=RangeError,Qe=TypeError,on=Error,Tn=void 0,os=typeof BigInt>"u"?Tn:BigInt,nh=RegExp,ih=WeakMap,hw=WeakMap.prototype.get,mw=WeakMap.prototype.set,Hn=Object.create,Hl=Number.isSafeInteger,Wi=Object.getOwnPropertyNames,Yn=Object.freeze,pw=Object.prototype.isPrototypeOf,Dn=Object.seal?Object.preventExtensions(Object.create(null)):null,hr=Function.prototype.bind,Zp=RegExp.prototype.test,Xp=RegExp.prototype.exec,sh=Reflect.apply,Ff=Proxy,Jp=typeof Symbol>"u"?Tn:Symbol.toStringTag,gw=Object.defineProperty,Es=Object.assign,lh=Object,dO=Math.floor,tl=Array.isArray,mr=1/0,rh=String.fromCharCode,za=Array,ia=Object.prototype.hasOwnProperty,Qp=Object.prototype.propertyIsEnumerable,Is=Function.prototype.apply;var _w=Qp.call.bind(Qp),ms=lh.hasOwn||function(){return ia.bind?ia.call.bind(ia):function(e,n){return ia.call(e,n)}}(),bw=lh.create;function xp(t){var e=bw(Dn);return ms(t,"value")&&(e.value=t.value),ms(t,"writable")&&(e.writable=t.writable),ms(t,"get")&&(e.get=t.get),ms(t,"set")&&(e.set=t.set),ms(t,"enumerable")&&(e.enumerable=t.enumerable),ms(t,"configurable")&&(e.configurable=t.configurable),e}const hO=function(e,n){if(!n&&typeof e!="function"&&(n=e,e=Hn(Dn)),Es)Es(e,n);else for(var i in n)ms(n,i)&&(e[i]=n[i]);if(e.default=e,typeof e=="function")e.prototype&&Yn(e.prototype);else if(Jp){var s=Hn(Dn);s.value="Module",gw(e,Jp,s)}return Yn(e)};/*!@preserve@license
224
225
  * 模块名称:j-regexp
225
226
  * 模块功能:可读性更好的正则表达式创建方式。从属于“简计划”。
226
227
       More readable way for creating RegExp. Belong to "Plan J".
@@ -423,7 +424,7 @@ ${f}`}catch{}}return""},tf=(t,e,n)=>{const{path:i,identifier_field:s="title"}=yi
423
424
  }
424
425
  }`),N.join("")}).join("").replace(/\s{2,}/g," "),{repository:h}=d?await Sh(`query { repository(owner: "${t}", name: "${e}") { ${d} } }`):{repository:{}},_=u.filter(({meta:w})=>!w).map(({sha:w,size:k,path:T},P)=>{const{author:{name:N,email:R,user:z},committedDate:$}=h[`commit_${P}`].target.history.nodes[0],C={sha:w,size:k,text:h[`content_${P}`]?.text,meta:{commitAuthor:{name:N,email:R,id:z?.id,login:z?.login},commitDate:new Date($)}};return[T,C]}),p=Object.fromEntries(_);ni.set(Ok(a.map(w=>({...w,text:w.text??p[w.path].text,meta:w.meta??p[w.path].meta})))),an.set(Ak(c.map(w=>({...w,url:null,fetchURL:w.url,repoFileURL:`https://github.com/${t}/${e}/blob/${n}/${w.path}`,name:w.path.split("/").pop(),meta:w.meta??p[w.path].meta})))),fo.set(!0);const b=u.map(({path:w})=>w),g=Object.keys(f).filter(w=>!b.includes(w));_.length&&await s.saveEntries(_),g.length&&s.deleteEntries(g)},KL=async t=>{const e=await Zc(t.fetchURL.replace("https://api.github.com",""),{headers:{Accept:"application/vnd.github.raw"},responseType:"raw"});return e.headers.get("Content-Type")!=="application/octet-stream"?new Blob([await e.text()],{type:M6.getType(t.path)}):e.blob()},ZL=async(t,{commitType:e="update",collection:n}={})=>{const{owner:i,repo:s,branch:l}=Do,r=await Promise.all(t.filter(({action:c})=>["create","update"].includes(c)).map(async({path:c,data:u,base64:f})=>({path:c,contents:f??await nO(u)}))),o=t.filter(({action:c})=>c==="delete").map(({path:c})=>({path:c})),{createCommitOnBranch:{commit:{url:a}}}=await Sh(`mutation ($input: CreateCommitOnBranchInput!) {
425
426
  createCommitOnBranch(input: $input) { commit { url } }
426
- }`,{input:{branch:{repositoryNameWithOwner:`${i}/${s}`,branchName:l},message:{headline:uO(t,{commitType:e,collection:n})},fileChanges:{additions:r,deletions:o},expectedHeadOid:await Lk()}});return a},XL={label:HL,repository:Do,init:VL,signIn:YL,signOut:GL,fetchFiles:WL,fetchBlob:KL,commitChanges:ZL},JL="Local Repository",Th=Ge(null),fd="root_dir_handle";let nc;const QL=async({forceReload:t=!1}={})=>{if(!("showDirectoryPicker"in window))throw new Error("unsupported");let e=t?void 0:await nc.get(fd);if(e)if(await e.requestPermission({mode:"readwrite"})!=="granted")e=void 0;else try{await e.entries().next()}catch{e=void 0}return e||(e=await window.showDirectoryPicker(),await nc.set(fd,e)),e},xL=async()=>{await nc.delete(fd)},e$=()=>{const{backend:t}=le(Ot);nc=new ud(`${t.name}:${t.repo}`,"file-system-handles")},t$=async()=>(Th.set(await QL()),{backendName:"local"}),n$=async()=>{xL()},Ag=async t=>{const e=Ci(t).split("/"),n=!0;let i=le(Th);for(const s of e)i=await(s.includes(".")?i.getFileHandle(s,{create:n}):i.getDirectoryHandle(s,{create:n}));return i},i$=async()=>{const t=le(Th),e=[],n=[...le(Qd).map(({file:r,folder:o})=>r??o),...le(_i).map(({internalPath:r})=>r)].map(r=>Ci(r)),i=r=>new RegExp(`^${Vt(r)}\\b`),s=n.map(i),l=async r=>{for await(const[o,a]of r.entries()){if(o.startsWith("."))continue;const c=(await t.resolve(a)).join("/"),u=s.some(f=>c.match(f));if(a.kind==="file"){if(!u)continue;try{const f=await a.getFile();e.push({file:f,path:c,name:o,sha:await Fa(f),size:f.size,text:o.match(/\.(?:json|markdown|md|toml|ya?ml)$/i)?await eO(f):null})}catch(f){console.error(f)}}if(a.kind==="directory"){const f=i(c);if(!u&&!n.some(d=>d.match(f)))continue;await l(a)}}};return await l(t),e},s$=async()=>{const{entryFiles:t,assetFiles:e}=cd(await i$());ni.set(Ok(t)),an.set(Ak(e)),fo.set(!0)},l$=async t=>{await Promise.all(t.map(async({action:e,path:n,data:i})=>{try{if(["create","update"].includes(e)){const l=await(await Ag(n)).createWritable();await l.write(i),await l.close()}if(e==="delete"){const[,s,l]=Ci(n).match(/(.+)\/([^/]+)$/);await(await Ag(s)).removeEntry(l)}}catch(s){console.error(s)}}))},r$={label:JL,init:e$,signIn:t$,signOut:n$,fetchFiles:s$,commitChanges:l$},$k={github:XL,local:r$},Mo=Ge(),bi=pn([Mo],([t],e)=>{const n=$k[t];n?.init(),e(n)}),Fi=Ge();Fi.subscribe(t=>{(async()=>{try{t?await sn.set("sveltia-cms.user",t):t===null&&await sn.delete("sveltia-cms.user")}catch{}})()});const Nk=Ge(""),ic=Ge(!1),dd=t=>{Nk.set(t.cause?.message||le(me)("unexpected_error")),console.error(t.message,t.cause)},o$=async()=>{const t=await sn.get("sveltia-cms.user")||await sn.get("decap-cms-user")||await sn.get("netlify-cms-user"),e=ji(t)&&t.backendName?t:{},n=!!window.location.hostname.match(/^(?:.+\.)?localhost$/),{backendName:i=n?"local":le(Ot).backend?.name,token:s}=e;if(Mo.set(i),!["local","proxy"].includes(i)&&le(bi)&&s&&!le(ic)){Fi.set(e);try{await le(bi).fetchFiles()}catch(l){[401,403].includes(l.cause?.status)?ic.set(!0):dd(l)}}},Lg=async(t="")=>{let e;try{e=await le(bi).signIn(t)}catch(n){dd(n);return}Fi.set(e);try{await le(bi).fetchFiles()}catch(n){dd(n)}};function a$(t){pe(t,"svelte-8a6wia",".buttons.svelte-8a6wia{display:flex;flex-direction:column;align-items:center;gap:16px}.buttons.svelte-8a6wia button{width:240px}")}function c$(t){let e,n=t[1]("config.error.unsupported_backend",{values:{name:t[0]}})+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&3&&n!==(n=s[1]("config.error.unsupported_backend",{values:{name:s[0]}})+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function u$(t){let e,n;return e=new Ye({props:{variant:"primary",label:t[1]("sign_in_with_x",{values:{service:t[2].label}})}}),e.$on("click",t[5]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&6&&(l.label=i[1]("sign_in_with_x",{values:{service:i[2].label}})),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function f$(t){let e,n,i,s;const l=[h$,d$],r=[];function o(a,c){return"showDirectoryPicker"in window?1:0}return e=o(),n=r[e]=l[e](t),{c(){n.c(),i=x()},m(a,c){r[e].m(a,c),S(a,i,c),s=!0},p(a,c){n.p(a,c)},i(a){s||(m(n),s=!0)},o(a){v(n),s=!1},d(a){a&&y(i),r[e].d(a)}}}function d$(t){let e,n;return e=new Ye({props:{variant:"primary",label:t[1]("work_with_local_repo")}}),e.$on("click",t[4]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&2&&(l.label=i[1]("work_with_local_repo")),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function h$(t){let e,n=t[1]("unsupported.browser")+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&2&&n!==(n=s[1]("unsupported.browser")+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function m$(t){let e,n,i,s;const l=[f$,u$,c$],r=[];function o(a,c){return a[0]==="local"?0:a[2]||a[3]?1:2}return n=o(t),i=r[n]=l[n](t),{c(){e=D("div"),i.c(),E(e,"role","none"),E(e,"class","buttons svelte-8a6wia")},m(a,c){S(a,e,c),r[n].m(e,null),s=!0},p(a,[c]){let u=n;n=o(a),n===u?r[n].p(a,c):(H(),v(r[u],1,1,()=>{r[u]=null}),V(),i=r[n],i?i.p(a,c):(i=r[n]=l[n](a),i.c()),m(i,1),i.m(e,null))},i(a){s||(m(i),s=!0)},o(a){v(i),s=!1},d(a){a&&y(e),r[n].d()}}}function p$(t,e,n){let i,s,l,r;return B(t,Mo,c=>n(0,i=c)),B(t,me,c=>n(1,s=c)),B(t,bi,c=>n(2,l=c)),B(t,ic,c=>n(3,r=c)),ln(()=>{o$()}),[i,s,l,r,async()=>{await Lg()},async()=>{await Lg()}]}class g$ extends ie{constructor(e){super(),ne(this,e,p$,m$,te,{},a$)}}const xr=Ge({saved:!1,deleted:!1,count:1}),Pk=async t=>{const e=le(ni),n=t.map(i=>{const{locales:s,slug:l}=e.find(r=>r.id===i)??{};if(s)return Object.values(s).map(({path:r})=>({action:"delete",slug:l,path:r}))}).flat(1).filter((i,s,l)=>i&&l.findIndex(r=>r.path===i.path)===s);await le(bi).commitChanges(n,{commitType:"delete",collection:le(Rt)}),ni.set(e.filter(i=>!t.includes(i.id))),xr.set({deleted:!0,count:t.length})},_$="deepl",b$="DeepL",v$="https://www.deepl.com/pro-api",w$="https://www.deepl.com/account/summary",k$=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?::fx)?/,y$=["BG,CS,DA,DE,EL,EN,ES,ET,FI,FR,HU,ID,IT,JA,KO,LT,LV,NB,NL,PL,PT,RO,RU,SK,SL,SV,TR,UK,ZH"].join(",").split(","),S$=["BG,CS,DA,DE,EL,EN,EN-GB,EN-US,ES,ET,FI,FR,HU,ID,IT,JA,KO,LT,LV,NB,NL,PL,PT,PT-BR,PT-PT,RO,RU,SK","SL,SV,TR,UK,ZH"].join(",").split(","),T$=async(t,{sourceLocale:e="",targetLocale:n,apiKey:i})=>{const s=new URLSearchParams([...t.map(a=>["text",a]),["source_lang",e.toUpperCase()],["target_lang",n.toUpperCase()],["tag_handling","html"],["split_sentences","1"],["auth_key",i]]),r=`https://${i.endsWith(":fx")?"api-free.deepl.com":"api.deepl.com"}/v2/translate?${s.toString()}`,{translations:o}=await fetch(r).then(a=>a.json());return o.map(a=>a.text)},Ik={serviceId:_$,serviceLabel:b$,developerURL:v$,apiKeyURL:w$,apiKeyPattern:k$,sourceLanguages:y$,targetLanguages:S$,translate:T$},$g={deepl:Ik},sc=Ge(Ik),Jl=Ge(!1),eo=Ge(),hd="sveltia-cms.entry-view",sl=Ge(null),ws=Ge(null),jo=Ge({}),Di=Ge({},t=>{(async()=>{try{const e={showPreview:!0,syncScrolling:!0,selectAssetsView:{type:"grid"},...await sn.get(hd)??{}};t(e),jo.set(e.selectAssetsView)}catch{}})()}),Je=Ge(),Xc=(t,e={})=>{const n={},i=({fieldConfig:s,keyPath:l})=>{if(l in e){n[l]=e[l];return}const{widget:r,default:o,required:a=!0}=s,c=Array.isArray(o)&&!!o.length;if(r==="list"){const{fields:u}=s;if(!c){n[l]=[];return}if(u){o.forEach((f,d)=>{Object.entries(f).forEach(([h,_])=>{n[[l,d,h].join(".")]=_})});return}o.forEach((f,d)=>{n[[l,d].join(".")]=f});return}if(r==="object"){if(!a)return;const{fields:u}=s;u.forEach(f=>{i({keyPath:[l,f.name].join("."),fieldConfig:f})});return}if(r==="boolean"){n[l]=typeof o=="boolean"?o:!1;return}if(r==="relation"||r==="select"){const{multiple:u=!1}=s;if(u){n[l]=c?o:[];return}}if(r==="date"||r==="datetime"){if(typeof o=="string")n[l]=o;else{const{date_format:u,time_format:f,picker_utc:d=!1}=s,{year:h,month:_,day:p,hour:b,minute:g}=Bc({timeZone:d?"UTC":void 0});f===!1?n[l]=`${h}-${_}-${p}`:u===!1?n[l]=`${b}:${g}`:n[l]=`${h}-${_}-${p}T${b}:${g}${d?"Z":""}`}return}n[l]=o!==void 0?o:""};return t.forEach(s=>{i({keyPath:s.name,fieldConfig:s})}),n},gr=({draft:{collectionName:t,fileName:e},prop:n="currentValues",locale:i,target:s={},getValueMap:l=void 0})=>{const r=yi(t),{defaultLocale:o="default"}=r._i18n;return new Proxy(s,{set:(a,c,u)=>{const f=typeof l=="function"?l():a,d=ri({collectionName:t,fileName:e,valueMap:f,keyPath:c});return d?(d.i18n==="duplicate"&&i===o&&Object.entries(le(Je)[n]).forEach(([h,_])=>{if(c.includes(".")){const[,p]=c.match(/(.+)\.[^.]+$/);if(!Object.keys(_).some(b=>b.startsWith(`${p}.`)))return}h!==i&&_[c]!==u&&(_[c]=u)}),Reflect.set(a,c,u)):!0}})},oa=(t,e)=>{const{id:n,collectionName:i,fileName:s,locales:l}=t,r=n===void 0,o=yi(i),{hasLocales:a,locales:c}=o._i18n,u=s?o.files?.find(({name:g})=>g===s):void 0,{fields:f}=u??o,d=Xc(f,e),h=a?c:["default"],_=r?h:h.filter(g=>!!l?.[g]?.content),p=Object.fromEntries(h.map(g=>[g,r||_.includes(g)])),b=Object.fromEntries(_.map(g=>[g,r?d:Mi(l?.[g].content)]));Je.set({isNew:r&&!s,collectionName:i,collection:o,fileName:s,collectionFile:u,originalEntry:r?void 0:t,originalLocales:p,currentLocales:structuredClone(p),originalValues:b,currentValues:Object.fromEntries(_.map(g=>[g,a?gr({draft:{collectionName:i,fileName:s},locale:g,target:structuredClone(b[g])}):structuredClone(b[g])])),files:Object.fromEntries(_.map(g=>[g,a?gr({draft:{collectionName:i,fileName:s},prop:"files",locale:g,getValueMap:()=>le(Je).currentValues[g]}):{}])),validities:Object.fromEntries(h.map(g=>[g,{}])),viewStates:Object.fromEntries(h.map(g=>[g,{}]))})},Ng=t=>ol(JSON.parse(JSON.stringify(t))),Pg=(t,e)=>e.split(".").reduce((n,i)=>{const s=i.match(/^\d+$/)?Number(i):i;return n[s]||=[],n[s]},t),Ck=(t,e,n)=>{const i=Ng(le(Je).currentValues[t]),s=Ng(le(Je).viewStates[t]);n({valueList:Pg(i,e),viewList:Pg(s,e)}),Je.update(l=>({...l,currentValues:{...l.currentValues,[t]:gr({draft:l,locale:t,target:Mi(i)})},viewStates:{...l.viewStates,[t]:Mi(s)}}))},md=(t,{prop:e="currentValues"}={})=>{const n=le(Je),{collectionName:i,fileName:s,collection:{_i18n:{defaultLocale:l="default"}}}=n,r=n[e][l],o=[...new Set([...Object.keys(t),...Object.keys(r)])],a={};return o.forEach(c=>{const u=ri({collectionName:i,fileName:s,keyPath:c})?.i18n==="duplicate";a[c]=(u?r[c]:void 0)??t[c]}),a},Dk=t=>{Je.update(e=>{const{currentLocales:n,currentValues:i}=e,s=!n[t];if(s&&!i[t]){const{collection:l,collectionName:r,collectionFile:o,fileName:a,originalValues:c,files:u}=e,{fields:f}=o??l,d=Xc(f),{_i18n:{defaultLocale:h="default"}}=l;return{...e,currentLocales:{...n,[t]:s},originalValues:{...c,[t]:d},currentValues:{...i,[t]:gr({draft:{collectionName:r,fileName:a},locale:t,target:md(d)})},files:{...u,[t]:gr({draft:{collectionName:r,fileName:a},prop:"files",locale:t,target:md(Object.fromEntries(Object.keys(u[h]).map(_=>[_,void 0])),{prop:"files"}),getValueMap:()=>le(Je).currentValues[t]})}}}return{...e,currentLocales:{...n,[t]:s}}})},pd=Ge({id:void 0,show:!1,status:void 0,message:void 0,count:1,sourceLocale:void 0}),Mk=async(t,e,n="",i=!1)=>{const{collectionName:s,fileName:l,currentValues:r}=le(Je),o=r[t],a=Object.fromEntries(Object.entries(o).filter(([h,_])=>{const p=ri({collectionName:s,fileName:l,valueMap:o,keyPath:h});return!(n&&!h.startsWith(n)||typeof _!="string"||!["markdown","text","string","list"].includes(p?.widget)||p?.widget==="list"&&(p.field??p.fields)||!i&&_===r[e][h])})),c=Object.keys(a).length,u=c===1?"one":"many",f=i?"translation":"copy",d=(h,_)=>{pd.set({id:Date.now(),show:!0,status:h,message:_,count:c,sourceLocale:t})};if(!c){d("info",`${f}.none`);return}if(i){const h=le(vt).apiKeys?.[le(sc)?.serviceId];if(!h)return;d("info","translation.started");try{const _=await le(sc).translate(Object.values(a),{apiKey:h,sourceLocale:t,targetLocale:e});Object.keys(a).forEach((p,b)=>{r[e][p]=_[b]}),d("success",`translation.complete.${u}`)}catch{d("error","translation.error")}}else Object.entries(a).forEach(([h,_])=>{r[e][h]=_}),d("success",`copy.complete.${u}`);Je.update(h=>({...h,currentValues:r}))},Eh=(t="",e="")=>{const{collection:n,fileName:i,currentValues:s,originalValues:l}=le(Je),{hasLocales:r,locales:o,defaultLocale:a="default"}=n._i18n,c=t?[t]:r?o:["default"],u=(f,d,h=!1)=>{Object.entries(d).forEach(([_,p])=>{if(!e||_.startsWith(e)){const b=ri({collectionName:n.name,fileName:i,valueMap:d,keyPath:_});(f===a||[!0,"translate"].includes(b?.i18n))&&(h?delete s[f][_]:s[f][_]=p)}})};c.forEach(f=>{u(f,s[f],!0),u(f,l[f],!1)}),Je.update(f=>({...f,currentValues:s}))},E$=()=>{const{collection:t,fileName:e,currentLocales:n,currentValues:i,validities:s}=le(Je),{hasLocales:l,defaultLocale:r="default"}=t._i18n;let o=!0;return Object.entries(i).forEach(([a,c])=>{const u=Object.entries(c);if(!n[a]){s[a]=Object.fromEntries(u.map(([f])=>[f,{valid:!0}]));return}s[a]={},u.forEach(([f,d])=>{const h=ri({collectionName:t.name,fileName:e,valueMap:c,keyPath:f});if(!h)return;const _=f.match(/\.(\d+)$/),{widget:p,required:b=!0,i18n:g=!1,pattern:w}=h,{multiple:k=!1}=h,{min:T,max:P}=h,R=b!==!1&&(a===r||l&&g!==!1);let z=!1,$=!1,C=!1,M=!1;if(_){if(Number(_[1])>0)return;f=f.replace(/\.\d+$/,"");const Z=new RegExp(`^${Vt(f)}\\.\\d+$`),G=u.filter(([Pe])=>Pe.match(Z)).map(([,Pe])=>Pe).filter(Pe=>Pe!==void 0)??[];R&&!G.length&&(z=!0),typeof T=="number"&&Array.isArray(d)&&d.length<T&&($=!0),typeof P=="number"&&Array.isArray(d)&&d.length>P&&(C=!0)}p==="list"&&Array.isArray(d)&&(typeof T=="number"&&d.length<T?$=!0:R&&!d.length&&(z=!0)),["object","list"].includes(p)||(R&&(d===void 0||d===""||k&&!d.length)&&(z=!0),Array.isArray(w)&&w.length===2&&!String(d).match(Vt(w[0]))&&(M=!0));const j={valueMissing:z,rangeUnderflow:$,rangeOverflow:C,patternMismatch:M},Q=!Object.values(j).some(Boolean);s[a][f]={...j,valid:Q},Q||(o=!1)})}),Je.update(a=>({...a,validities:s})),o},Ig=(t,e,n)=>{const{collection:i,collectionFile:s,originalEntry:l,currentValues:r}=t;if(s)return s.file;if(l?.locales[e])return l?.locales[e].path;const{structure:o,defaultLocale:a}=i._i18n,c=i.folder?.replace(/\/$/,""),u=i.path?ho(i.path,{collection:i,content:r[a],currentSlug:n}):n,f=yh({format:i.format,extension:i.extension}),d=`${c}/${u}.${f}`,h={multiple_folders:`${c}/${e}/${u}.${f}`,multiple_files:`${c}/${u}.${e}.${f}`,single_file:d};return h[o]||h.single_file},O$=async()=>{if(!E$())throw new Error("validation_failed");const t=le(Fi),e=le(Je),{collection:n,isNew:i,originalLocales:s,currentLocales:l,originalEntry:r,collectionName:o,collectionFile:a,fileName:c,currentValues:u,files:f}=e,{identifier_field:d="title",slug:h=`{{${d}}}`,_i18n:{structure:_,hasLocales:p,locales:b,defaultLocale:g="default"}}=n,w={collection:n,content:u[g]},k=c||r?.slug||ho(h,w),{internalAssetFolder:T,publicAssetFolder:P}=lO(n,{...w,currentSlug:k,isMediaFolder:!0,entryFilePath:Ig(e,g,k)}),N=le(an).map(U=>U.path).filter(U=>U.match(`^\\/${Vt(T)}\\/[^\\/]+$`)),R=[],z=[],$={text:void 0,collectionName:o,folder:T,commitAuthor:t.email?{name:t.name,email:t.email}:void 0,commitDate:new Date},C=Object.fromEntries(await Promise.all(Object.entries(u).map(async([U,J])=>{const Ce=Ig(e,U,k);if(!l[U])return[U,{path:Ce}];for(const[He,ee]of Object.entries(J)){if(ee===void 0){delete J[He];continue}if(typeof ee!="string")continue;J[He]=ee.trim();const[,kt,Be]=ee.match(/^data:(.+?\/.+?);base64,(.+)/)??[];if(kt){const Kt=f[U][He]||await(async()=>{const Et=await(await fetch(ee)).blob(),[Yt,Bt]=kt.split("/"),[ds]=Bt.split("+");return new File([Et],`${Yt}-${Date.now()}.${ds}`,{type:kt})})(),Xe=await Fa(Kt),bn=z.find(Ft=>Ft.sha===Xe);if(bn){J[He]=P?`${P}/${bn.name}`:bn.name;continue}const Mt=eh(Kt.name,[...N,...z.map(Ft=>Ft.name)]),ci=`${T}/${Mt}`;R.push({action:"create",path:ci,data:Kt,base64:Be}),z.push({...$,url:URL.createObjectURL(Kt),name:Mt,path:ci,sha:Xe,size:Kt.size,kind:th(Mt)}),J[He]=P?`${P}/${Mt}`:Mt}}const we=ol(J),mt=await Fa(new Blob([we],{type:"text/plain"}));return[U,{content:we,sha:mt,path:Ce}]}))),M={id:`${o}/${k}`,collectionName:o,fileName:c,slug:k,sha:C[g].sha,locales:Object.fromEntries(Object.entries(C).filter(([,{content:U}])=>!!U))},{extension:j,format:Q,frontmatter_delimiter:de,yaml_quote:Z}=n,G={extension:j,format:Q,frontmatterDelimiter:de,yamlQuote:Z};if(a||!p||_==="single_file"){const{path:U,content:J}=C[g];R.push({action:i?"create":"update",slug:k,path:U,data:Og({content:p?Object.fromEntries(Object.entries(C).map(([Ce,we])=>[Ce,we.content])):J,path:U,config:G})})}else b.forEach(U=>{const{path:J,content:Ce}=C[U];l[U]?R.push({action:i||!s[U]?"create":"update",slug:k,path:J,data:Og({content:Ce,path:J,config:G})}):s[U]&&R.push({action:"delete",slug:k,path:J})});try{await le(bi).commitChanges(R,{commitType:i?"create":"update",collection:n})}catch{throw new Error("saving_failed")}const Pe=z.map(U=>U.path);ni.update(U=>[...U.filter(J=>J.id!==M.id),M]),an.update(U=>[...U.filter(J=>!Pe.includes(J.path)),...z]),Je.set(null),xr.set({saved:!0,count:1})};Je.subscribe(t=>{le(vt).devModeEnabled&&console.info("entryDraft",t)});jo.subscribe(t=>{const e=le(Di).selectAssetsView??{};jn(t,e)||Di.update(n=>({...n,selectAssetsView:t}))});Di.subscribe(t=>{!t||!Object.keys(t).length||(async()=>{try{jn(t,await sn.get(hd))||await sn.set(hd,t)}catch{}})()});const jk=pn([Je,el],([t,e],n)=>{n(!!(t||e))}),Sa=Ge(""),In=Ge(""),Ro=(t=window.location)=>{const{pathname:e,searchParams:n}=new URL(`${t.origin}${t.hash.substring(1)}`);return{path:decodeURIComponent(e),params:Object.fromEntries([...n.entries()])}},mn=(t,{state:e={},replaceState:n=!1,notifyChange:i=!0}={})=>{const s=window.location.hash,l=`#${t}`,r=[{...e,from:s},"",l];n?window.history.replaceState(...r):window.history.pushState(...r),i&&window.dispatchEvent(new HashChangeEvent("hashchange",{oldURL:s,newURL:l}))},Ql=(t,e={})=>{window.history.state?.from?window.history.back():mn(t,e)},Rk=()=>{const{display_url:t,site_url:e}=le(Ot);window.open(t||e||"/","_blank")};function A$(t){pe(t,"svelte-1vpdavd",".container.svelte-1vpdavd.svelte-1vpdavd.svelte-1vpdavd{position:fixed;inset:32px;display:flex;justify-content:center;align-items:center;gap:16px}.container.svelte-1vpdavd .inner.svelte-1vpdavd.svelte-1vpdavd{display:flex;flex-direction:column;align-items:center;gap:32px;min-width:240px;max-width:800px;height:240px}.container.svelte-1vpdavd .logo.svelte-1vpdavd.svelte-1vpdavd{max-width:160px;height:auto}.container.svelte-1vpdavd h1.svelte-1vpdavd.svelte-1vpdavd{font-size:48px}.container.svelte-1vpdavd .logo.svelte-1vpdavd~h1.svelte-1vpdavd{font-size:var(--sui-font-size-xxx-large)}.container.svelte-1vpdavd .message.svelte-1vpdavd.svelte-1vpdavd{margin:0 0 16px;font-size:var(--sui-font-size-large);font-weight:normal;text-align:center}.container.svelte-1vpdavd .error.svelte-1vpdavd.svelte-1vpdavd{border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);line-height:1.5;text-align:center}")}function L$(t){let e,n=t[0]("loading_site_data")+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&1&&n!==(n=s[0]("loading_site_data")+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function $$(t){let e,n;return e=new g$({}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function N$(t){let e,n,i=t[0]("loading_site_data_error")+"",s,l,r,o=On.sanitize(at.parseInline(t[3]),{ALLOWED_TAGS:["a","code"],ALLOWED_ATTR:["href"]})+"";return{c(){e=D("div"),n=D("div"),s=K(i),l=F(),r=D("div"),E(n,"role","none"),E(n,"class","message svelte-1vpdavd"),E(r,"role","none"),E(r,"class","error svelte-1vpdavd"),E(e,"role","alert")},m(a,c){S(a,e,c),I(e,n),I(n,s),I(e,l),I(e,r),r.innerHTML=o},p(a,c){c&1&&i!==(i=a[0]("loading_site_data_error")+"")&&X(s,i),c&8&&o!==(o=On.sanitize(at.parseInline(a[3]),{ALLOWED_TAGS:["a","code"],ALLOWED_ATTR:["href"]})+"")&&(r.innerHTML=o)},i:q,o:q,d(a){a&&y(e)}}}function P$(t){let e,n=t[0](`prefs.error.${t[2].error}`)+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&5&&n!==(n=s[0](`prefs.error.${s[2].error}`)+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function I$(t){let e,n=t[1].error+"",i,s,l=t[0]("config.error.try_again")+"",r;return{c(){e=D("div"),i=K(n),s=F(),r=K(l),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(o,a){S(o,e,a),I(e,i),I(e,s),I(e,r)},p(o,a){a&2&&n!==(n=o[1].error+"")&&X(i,n),a&1&&l!==(l=o[0]("config.error.try_again")+"")&&X(r,l)},i:q,o:q,d(o){o&&y(e)}}}function C$(t){let e,n=t[0]("loading_site_config")+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&1&&n!==(n=s[0]("loading_site_config")+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function D$(t){let e,n,i,s,l,r,o,a,c,u;const f=[C$,I$,P$,N$,$$,L$],d=[];function h(_,p){return!_[1]||!_[2]?0:_[1].error?1:_[2].error?2:_[3]?3:!_[4]||_[5]?4:_[6]?-1:5}return~(a=h(t))&&(c=d[a]=f[a](t)),{c(){e=D("div"),n=D("div"),i=D("img"),l=F(),r=D("h1"),r.textContent="Sveltia CMS",o=F(),c&&c.c(),E(i,"loading","lazy"),gi(i.src,s=t[1]?.logo_url||`data:image/svg+xml;base64,${btoa(Of)}`)||E(i,"src",s),E(i,"alt",""),E(i,"class","logo svelte-1vpdavd"),E(r,"class","svelte-1vpdavd"),E(n,"role","none"),E(n,"class","inner svelte-1vpdavd"),E(e,"role","none"),E(e,"class","container svelte-1vpdavd")},m(_,p){S(_,e,p),I(e,n),I(n,i),I(n,l),I(n,r),I(n,o),~a&&d[a].m(n,null),u=!0},p(_,[p]){(!u||p&2&&!gi(i.src,s=_[1]?.logo_url||`data:image/svg+xml;base64,${btoa(Of)}`))&&E(i,"src",s);let b=a;a=h(_),a===b?~a&&d[a].p(_,p):(c&&(H(),v(d[b],1,1,()=>{d[b]=null}),V()),~a?(c=d[a],c?c.p(_,p):(c=d[a]=f[a](_),c.c()),m(c,1),c.m(n,null)):c=null)},i(_){u||(m(c),u=!0)},o(_){v(c),u=!1},d(_){_&&y(e),~a&&d[a].d()}}}function M$(t,e,n){let i,s,l,r,o,a,c,u;return B(t,me,f=>n(0,i=f)),B(t,In,f=>n(7,s=f)),B(t,Ot,f=>n(1,l=f)),B(t,vt,f=>n(2,r=f)),B(t,Nk,f=>n(3,o=f)),B(t,Fi,f=>n(4,a=f)),B(t,ic,f=>n(5,c=f)),B(t,fo,f=>n(6,u=f)),ln(()=>{Q8()}),t.$$.update=()=>{t.$$.dirty&1&&$e(In,s=i("welcome_to_sveltia_cms"),s)},[i,l,r,o,a,c,u]}class j$ extends ie{constructor(e){super(),ne(this,e,M$,D$,te,{},A$)}}const gd="sveltia-cms.assets-view",R$=(t,e,n)=>e==="eager"?mo(t):new Promise(i=>{const s=new IntersectionObserver(([l])=>{l.isIntersecting&&(s.disconnect(),i(mo(t)))});s.observe(n)}),to=t=>t==="*"?le(me)("all_assets"):t?le(Ot).collections.find(({name:e})=>e===t)?.label??"":le(me)("uncategorized"),_r=t=>{const{media_folder:e}=le(Ot);if(!t)return to("*");if(t===e)return to(void 0);const n=le(_i).find(({internalPath:i})=>i===t);return n?to(n.collectionName):""},F$=(t,{key:e,order:n}={})=>{if(!e||!n)return t;const i=[...t],s={commit_author:String,commit_date:Date}[e]||i[0]?.[e]?.constructor||String,l=r=>{const{commitAuthor:{name:o,login:a,email:c}={},commitDate:u}=r;return e==="commit_author"?o||a||c:e==="commit_date"?u:e==="name"?r.name.split(".")[0]:r[e]??""};return i.sort((r,o)=>{const a=l(r),c=l(o);return s===String?a.localeCompare(c):s===Date?Number(a)-Number(c):a-c}),n==="descending"&&i.reverse(),i},z$=(t,{field:e,pattern:n}={field:void 0,pattern:void 0})=>{if(!e)return t;if(e==="fileType")return t.filter(({path:s})=>n==="other"?!Object.values(jf).some(l=>s.match(l)):s.match(jf[n]));const i=typeof n=="string"?new RegExp(n):void 0;return t.filter(s=>{const l=s[e];return i?String(l??"").match(i):l===n})},B$=(t,{field:e,pattern:n}={field:void 0,pattern:void 0})=>{if(!e)return t.length?{"*":t}:{};const i=typeof n=="string"?new RegExp(n):void 0,s={},l=le(me)("other");return t.forEach(r=>{const o=r[e];let a;i?[a=l]=String(o??"").match(i)??[]:a=o,a in s||(s[a]=[]),s[a].push(r)}),Object.fromEntries(Object.entries(s).sort(([r],[o])=>r.localeCompare(o)))},U$={type:"grid",sort:{key:"name",order:"ascending"}},Vn=Ge({}),lc=Ge({},t=>{(async()=>{try{t(await sn.get(gd)??{}),mi.subscribe(e=>{const n=le(lc)[e||"*"]??structuredClone(U$);jn(n,le(Vn))||Vn.set(n)})}catch{}})()}),q$=pn([an,xt],([t],e)=>{const{commitAuthor:n,commitDate:i}=t?.[0]??{},s=["name"];n&&s.push("commit_author"),i&&s.push("commit_date"),e(s.map(l=>({key:l,label:le(me)(`sort_keys.${l}`)})))}),gl=pn([an,mi],([t,e],n)=>{n(t&&e?t.filter(({folder:i})=>e===i):t?[...t]:[])}),Fk=pn([gl,Vn],([t,e],n)=>{let i=[...t];i=F$(i,e?.sort),i=z$(i,e?.filter),n(B$(i,e?.group))});gl.subscribe(t=>{xs.set([]),le(vt).devModeEnabled&&console.info("listedAssets",t)});Vn.subscribe(t=>{const e=le(mi)||"*",n=le(lc)[e]??{};jn(t,n)||lc.update(i=>({...i,[e]:t}))});lc.subscribe(t=>{!t||!Object.keys(t).length||(async()=>{try{jn(t,await sn.get(gd))||await sn.set(gd,t)}catch{}})()});const no=Ge({saved:!1,deleted:!1,count:1}),H$=async({files:t,folder:e},n)=>{const i=le(an).map(o=>o.path).filter(o=>o.match(`^${Vt(e)}\\/[^\\/]+$`)).map(o=>o.split("/").pop()),s=t.map(o=>{const a=eh(o.name,i),c=[e,a].join("/");return i.push(a),{name:a,path:c,file:o}});await le(bi).commitChanges(s.map(({path:o,file:a})=>({action:"create",path:o,data:a})),n);const{collectionName:l=null}=le(_i).findLast(({internalPath:o})=>e===o)??{},r=await Promise.all(s.map(async({name:o,path:a,file:c})=>({url:URL.createObjectURL(c),name:o,path:a,sha:await Fa(c),size:c.size,kind:th(o),text:null,collectionName:l,folder:e})));an.update(o=>[...o.filter(a=>!r.some(c=>c.path===a.path)),...r]),no.set({saved:!0,count:t.length})},V$=async t=>{await le(bi).commitChanges(t.map(({path:e})=>({action:"delete",path:e})),{commitType:"deleteMedia"}),an.update(e=>e.filter(n=>!t.includes(n))),no.set({deleted:!0,count:t.length})};function Y$(t){let e=t[3]("confirm_deleting_selected_assets",{values:{count:t[2].length}})+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&12&&e!==(e=i[3]("confirm_deleting_selected_assets",{values:{count:i[2].length}})+"")&&X(n,e)},d(i){i&&y(n)}}}function G$(t){let e=t[3]("confirm_deleting_all_assets")+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&8&&e!==(e=i[3]("confirm_deleting_all_assets")+"")&&X(n,e)},d(i){i&&y(n)}}}function W$(t){let e=t[3]("confirm_deleting_selected_asset")+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&8&&e!==(e=i[3]("confirm_deleting_selected_asset")+"")&&X(n,e)},d(i){i&&y(n)}}}function K$(t){let e;return{c(){e=K(t[1])},m(n,i){S(n,e,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&y(e)}}}function Z$(t){let e;function n(l,r){return l[1]?K$:l[2].length===1?W$:l[2].length===l[4].length?G$:Y$}let i=n(t),s=i(t);return{c(){s.c(),e=x()},m(l,r){s.m(l,r),S(l,e,r)},p(l,r){i===(i=n(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function X$(t){let e,n,i;function s(r){t[6](r)}let l={title:t[2].length===1?t[3]("delete_asset"):t[3]("delete_assets"),okLabel:t[3]("delete"),$$slots:{default:[Z$]},$$scope:{ctx:t}};return t[0]!==void 0&&(l.open=t[0]),e=new Oo({props:l}),ae.push(()=>De(e,"open",s)),e.$on("ok",t[7]),{c(){L(e.$$.fragment)},m(r,o){O(e,r,o),i=!0},p(r,[o]){const a={};o&12&&(a.title=r[2].length===1?r[3]("delete_asset"):r[3]("delete_assets")),o&8&&(a.okLabel=r[3]("delete")),o&286&&(a.$$scope={dirty:o,ctx:r}),!n&&o&1&&(n=!0,a.open=r[0],je(()=>n=!1)),e.$set(a)},i(r){i||(m(e.$$.fragment,r),i=!0)},o(r){v(e.$$.fragment,r),i=!1},d(r){A(e,r)}}}function J$(t,e,n){let i,s;B(t,me,f=>n(3,i=f)),B(t,gl,f=>n(4,s=f));let{open:l=!1}=e,{description:r=""}=e,{assets:o=[]}=e;const a=Ms();function c(f){l=f,n(0,l)}const u=()=>{V$(o),a("delete")};return t.$$set=f=>{"open"in f&&n(0,l=f.open),"description"in f&&n(1,r=f.description),"assets"in f&&n(2,o=f.assets)},[l,r,o,i,s,a,c,u]}class zk extends ie{constructor(e){super(),ne(this,e,J$,X$,te,{open:0,description:1,assets:2})}}function Q$(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"arrow_back_ios_new"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function x$(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"delete"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function e5(t){let e,n,i,s=t[3].name+"",l,r,o,a,c,u;return e=new Ye({props:{variant:"ghost",iconic:!0,"aria-label":t[1]("cancel_editing"),$$slots:{"start-icon":[Q$]},$$scope:{ctx:t}}}),e.$on("click",t[4]),o=new En({props:{flex:!0}}),c=new Ye({props:{variant:"secondary",label:t[1]("delete"),"aria-label":t[1]("delete_asset"),$$slots:{"start-icon":[x$]},$$scope:{ctx:t}}}),c.$on("click",t[5]),{c(){L(e.$$.fragment),n=F(),i=D("h2"),l=K(s),r=F(),L(o.$$.fragment),a=F(),L(c.$$.fragment),E(i,"role","none")},m(f,d){O(e,f,d),S(f,n,d),S(f,i,d),I(i,l),S(f,r,d),O(o,f,d),S(f,a,d),O(c,f,d),u=!0},p(f,d){const h={};d&2&&(h["aria-label"]=f[1]("cancel_editing")),d&256&&(h.$$scope={dirty:d,ctx:f}),e.$set(h),(!u||d&8)&&s!==(s=f[3].name+"")&&X(l,s);const _={};d&2&&(_.label=f[1]("delete")),d&2&&(_["aria-label"]=f[1]("delete_asset")),d&256&&(_.$$scope={dirty:d,ctx:f}),c.$set(_)},i(f){u||(m(e.$$.fragment,f),m(o.$$.fragment,f),m(c.$$.fragment,f),u=!0)},o(f){v(e.$$.fragment,f),v(o.$$.fragment,f),v(c.$$.fragment,f),u=!1},d(f){f&&(y(n),y(i),y(r),y(a)),A(e,f),A(o,f),A(c,f)}}}function t5(t){let e,n,i,s,l;e=new Rs({props:{variant:"primary","aria-label":t[1]("primary"),$$slots:{default:[e5]},$$scope:{ctx:t}}});function r(a){t[6](a)}let o={description:t[1]("confirm_deleting_this_asset"),assets:[t[3]]};return t[0]!==void 0&&(o.open=t[0]),i=new zk({props:o}),ae.push(()=>De(i,"open",r)),i.$on("delete",t[7]),{c(){L(e.$$.fragment),n=F(),L(i.$$.fragment)},m(a,c){O(e,a,c),S(a,n,c),O(i,a,c),l=!0},p(a,[c]){const u={};c&2&&(u["aria-label"]=a[1]("primary")),c&271&&(u.$$scope={dirty:c,ctx:a}),e.$set(u);const f={};c&2&&(f.description=a[1]("confirm_deleting_this_asset")),c&8&&(f.assets=[a[3]]),!s&&c&1&&(s=!0,f.open=a[0],je(()=>s=!1)),i.$set(f)},i(a){l||(m(e.$$.fragment,a),m(i.$$.fragment,a),l=!0)},o(a){v(e.$$.fragment,a),v(i.$$.fragment,a),l=!1},d(a){a&&y(n),A(e,a),A(i,a)}}}function n5(t,e,n){let i,s,l;B(t,me,f=>n(1,i=f)),B(t,mi,f=>n(2,s=f)),B(t,el,f=>n(3,l=f));let r=!1;const o=()=>{Ql(s?`/assets/${s}`:"/assets")},a=()=>{n(0,r=!0)};function c(f){r=f,n(0,r)}return[r,i,s,l,o,a,c,()=>{Ql(s?`/assets/${s}`:"/assets")}]}let i5=class extends ie{constructor(e){super(),ne(this,e,n5,t5,te,{})}};function s5(t){pe(t,"svelte-1yvh9sv",".preview.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%}.preview.tile.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{border-width:1px;border-style:solid;border-color:transparent;padding:var(--tile-padding, 8px);background-color:var(--sui-secondary-background-color)}.preview.icon.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{width:40px;height:40px}.preview.tile.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv,.preview.icon.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{overflow:hidden;border-radius:var(--sui-control-medium-border-radius);aspect-ratio:1/1}.preview.svelte-1yvh9sv .blur.svelte-1yvh9sv.svelte-1yvh9sv{display:contents}.preview.svelte-1yvh9sv .blur.svelte-1yvh9sv>.svelte-1yvh9sv{position:absolute;inset:0;pointer-events:none}.preview.svelte-1yvh9sv .blur.svelte-1yvh9sv .overlay{z-index:-1;backdrop-filter:blur(32px) brightness(0.8)}.preview.svelte-1yvh9sv .blur img.svelte-1yvh9sv.svelte-1yvh9sv,.preview.svelte-1yvh9sv .blur video.svelte-1yvh9sv.svelte-1yvh9sv{width:100%;height:100%;z-index:-2;object-fit:contain;transform:scale(1.2)}.preview.cover.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{padding:0}.preview.svelte-1yvh9sv>video.svelte-1yvh9sv.svelte-1yvh9sv,.preview.svelte-1yvh9sv>img.svelte-1yvh9sv.svelte-1yvh9sv{max-width:100%;max-height:100%}.preview.dissolve.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv,.preview.dissolve.svelte-1yvh9sv video.svelte-1yvh9sv.svelte-1yvh9sv{opacity:0;transition:opacity 250ms}.preview.dissolve.loaded.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv,.preview.dissolve.loaded.svelte-1yvh9sv video.svelte-1yvh9sv.svelte-1yvh9sv{opacity:1}.checkerboard.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv{background-image:linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%), linear-gradient(45deg, #eee 25%, #fff 25%, #fff 75%, #eee 75%);background-size:16px 16px;background-position:0 0, 8px 8px}.svelte-1yvh9sv:not(.checkerboard) img.svelte-1yvh9sv.svelte-1yvh9sv{background-color:#fff}video.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv,img.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{object-fit:contain}video.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv:not([src]),img.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv:not([src]){visibility:hidden}.cover.svelte-1yvh9sv video.svelte-1yvh9sv.svelte-1yvh9sv,.cover.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv{object-fit:cover;aspect-ratio:1/1}")}function l5(t){let e,n,i=[{loading:t[2]},{src:n=t[0]},{alt:t[8]},t[11]],s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return{c(){e=D("img"),Ae(e,s),se(e,"svelte-1yvh9sv",!0)},m(l,r){S(l,e,r),t[14](e)},p(l,r){Ae(e,s=Re(i,[r&4&&{loading:l[2]},r&1&&!gi(e.src,n=l[0])&&{src:n},r&256&&{alt:l[8]},r&2048&&l[11]])),se(e,"svelte-1yvh9sv",!0)},d(l){l&&y(e),t[14](null)}}}function r5(t){let e,n,i=[{playsInline:!0},{src:n=t[0]},t[11]],s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return{c(){e=D("video"),Ae(e,s),se(e,"svelte-1yvh9sv",!0)},m(l,r){S(l,e,r),t[13](e)},p(l,r){Ae(e,s=Re(i,[{playsInline:!0},r&1&&!gi(e.src,n=l[0])&&{src:n},r&2048&&l[11]])),se(e,"svelte-1yvh9sv",!0)},d(l){l&&y(e),t[13](null)}}}function Cg(t){let e,n,i;function s(o,a){return o[1]==="video"?a5:o5}let l=s(t),r=l(t);return{c(){e=D("div"),n=D("div"),i=F(),r.c(),E(n,"role","none"),E(n,"class","overlay svelte-1yvh9sv"),E(e,"role","none"),E(e,"class","blur svelte-1yvh9sv")},m(o,a){S(o,e,a),I(e,n),I(e,i),r.m(e,null)},p(o,a){l===(l=s(o))&&r?r.p(o,a):(r.d(1),r=l(o),r&&(r.c(),r.m(e,null)))},d(o){o&&y(e),r.d()}}}function o5(t){let e,n;return{c(){e=D("img"),E(e,"loading",t[2]),gi(e.src,n=t[0])||E(e,"src",n),E(e,"alt",""),E(e,"class","svelte-1yvh9sv")},m(i,s){S(i,e,s)},p(i,s){s&4&&E(e,"loading",i[2]),s&1&&!gi(e.src,n=i[0])&&E(e,"src",n)},d(i){i&&y(e)}}}function a5(t){let e,n;return{c(){e=D("video"),e.playsInline=!0,gi(e.src,n=t[0])||E(e,"src",n),E(e,"class","svelte-1yvh9sv")},m(i,s){S(i,e,s)},p(i,s){s&1&&!gi(e.src,n=i[0])&&E(e,"src",n)},d(i){i&&y(e)}}}function c5(t){let e,n,i;function s(a,c){return a[1]==="video"?r5:l5}let l=s(t),r=l(t),o=t[4]&&Cg(t);return{c(){e=D("div"),r.c(),n=F(),o&&o.c(),E(e,"role","none"),E(e,"class",i="preview "+(t[3]??"")+" svelte-1yvh9sv"),se(e,"cover",t[5]),se(e,"checkerboard",t[6]),se(e,"dissolve",t[7]),se(e,"loaded",t[10])},m(a,c){S(a,e,c),r.m(e,null),I(e,n),o&&o.m(e,null)},p(a,[c]){l===(l=s(a))&&r?r.p(a,c):(r.d(1),r=l(a),r&&(r.c(),r.m(e,n))),a[4]?o?o.p(a,c):(o=Cg(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null),c&8&&i!==(i="preview "+(a[3]??"")+" svelte-1yvh9sv")&&E(e,"class",i),c&40&&se(e,"cover",a[5]),c&72&&se(e,"checkerboard",a[6]),c&136&&se(e,"dissolve",a[7]),c&1032&&se(e,"loaded",a[10])},i:q,o:q,d(a){a&&y(e),r.d(),o&&o.d()}}}function u5(t,e,n){const i=["type","loading","asset","src","variant","blurBackground","cover","checkerboard","dissolve","alt"];let s=re(e,i),{type:l}=e,{loading:r="lazy"}=e,{asset:o=void 0}=e,{src:a=void 0}=e,{variant:c=void 0}=e,{blurBackground:u=!1}=e,{cover:f=!1}=e,{checkerboard:d=!1}=e,{dissolve:h=!0}=e,{alt:_=""}=e,p,b=!1,g=!1;const w=async()=>{o&&p&&!b&&(b=!0,n(0,a=await R$(o,r,p)),b=!1)};ln(()=>{const P=p.matches("video");(P?p.readyState>0:p.complete)?n(10,g=!0):p.addEventListener(P?"loadedmetadata":"load",()=>{n(10,g=!0)},{once:!0})});function k(P){ae[P?"unshift":"push"](()=>{p=P,n(9,p)})}function T(P){ae[P?"unshift":"push"](()=>{p=P,n(9,p)})}return t.$$set=P=>{e=W(W({},e),Ve(P)),n(11,s=re(e,i)),"type"in P&&n(1,l=P.type),"loading"in P&&n(2,r=P.loading),"asset"in P&&n(12,o=P.asset),"src"in P&&n(0,a=P.src),"variant"in P&&n(3,c=P.variant),"blurBackground"in P&&n(4,u=P.blurBackground),"cover"in P&&n(5,f=P.cover),"checkerboard"in P&&n(6,d=P.checkerboard),"dissolve"in P&&n(7,h=P.dissolve),"alt"in P&&n(8,_=P.alt)},t.$$.update=()=>{t.$$.dirty&4608&&w()},[a,l,r,c,u,f,d,h,_,p,g,s,o,k,T]}class Bk extends ie{constructor(e){super(),ne(this,e,u5,c5,te,{type:1,loading:2,asset:12,src:0,variant:3,blurBackground:4,cover:5,checkerboard:6,dissolve:7,alt:8},s5)}}function f5(t){let e,n;const i=[{type:"image"},{loading:t[0]},{asset:t[1]},{src:t[2]},{variant:t[3]},{blurBackground:t[4]},{cover:t[5]},{checkerboard:t[6]},{alt:t[7]},t[8]];let s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return e=new Bk({props:s}),{c(){L(e.$$.fragment)},m(l,r){O(e,l,r),n=!0},p(l,[r]){const o=r&511?Re(i,[i[0],r&1&&{loading:l[0]},r&2&&{asset:l[1]},r&4&&{src:l[2]},r&8&&{variant:l[3]},r&16&&{blurBackground:l[4]},r&32&&{cover:l[5]},r&64&&{checkerboard:l[6]},r&128&&{alt:l[7]},r&256&&Lt(l[8])]):{};e.$set(o)},i(l){n||(m(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){A(e,l)}}}function d5(t,e,n){const i=["loading","asset","src","variant","blurBackground","cover","checkerboard","alt"];let s=re(e,i),{loading:l="lazy"}=e,{asset:r=void 0}=e,{src:o=void 0}=e,{variant:a=void 0}=e,{blurBackground:c=!1}=e,{cover:u=!1}=e,{checkerboard:f=!1}=e,{alt:d=""}=e;return t.$$set=h=>{e=W(W({},e),Ve(h)),n(8,s=re(e,i)),"loading"in h&&n(0,l=h.loading),"asset"in h&&n(1,r=h.asset),"src"in h&&n(2,o=h.src),"variant"in h&&n(3,a=h.variant),"blurBackground"in h&&n(4,c=h.blurBackground),"cover"in h&&n(5,u=h.cover),"checkerboard"in h&&n(6,f=h.checkerboard),"alt"in h&&n(7,d=h.alt)},[l,r,o,a,c,u,f,d,s]}let Si=class extends ie{constructor(e){super(),ne(this,e,d5,f5,te,{loading:0,asset:1,src:2,variant:3,blurBackground:4,cover:5,checkerboard:6,alt:7})}};function h5(t){let e,n;const i=[{type:"video"},{loading:t[0]},{asset:t[1]},{src:t[2]},{variant:t[3]},{blurBackground:t[4]},{cover:t[5]},t[6]];let s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return e=new Bk({props:s}),{c(){L(e.$$.fragment)},m(l,r){O(e,l,r),n=!0},p(l,[r]){const o=r&127?Re(i,[i[0],r&1&&{loading:l[0]},r&2&&{asset:l[1]},r&4&&{src:l[2]},r&8&&{variant:l[3]},r&16&&{blurBackground:l[4]},r&32&&{cover:l[5]},r&64&&Lt(l[6])]):{};e.$set(o)},i(l){n||(m(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){A(e,l)}}}function m5(t,e,n){const i=["loading","asset","src","variant","blurBackground","cover"];let s=re(e,i),{loading:l="lazy"}=e,{asset:r=void 0}=e,{src:o=void 0}=e,{variant:a=void 0}=e,{blurBackground:c=!1}=e,{cover:u=!1}=e;return t.$$set=f=>{e=W(W({},e),Ve(f)),n(6,s=re(e,i)),"loading"in f&&n(0,l=f.loading),"asset"in f&&n(1,r=f.asset),"src"in f&&n(2,o=f.src),"variant"in f&&n(3,a=f.variant),"blurBackground"in f&&n(4,c=f.blurBackground),"cover"in f&&n(5,u=f.cover)},[l,r,o,a,c,u,s]}class Nr extends ie{constructor(e){super(),ne(this,e,m5,h5,te,{loading:0,asset:1,src:2,variant:3,blurBackground:4,cover:5})}}function p5(t){pe(t,"svelte-qwt9km",".detail.svelte-qwt9km.svelte-qwt9km{flex:none;overflow-x:hidden;overflow-y:auto;width:320px;padding:16px}.detail.svelte-qwt9km .preview.svelte-qwt9km{overflow:hidden;margin:0 0 16px;border-radius:var(--sui-control-medium-border-radius);aspect-ratio:1/1}.detail.svelte-qwt9km section.svelte-qwt9km{margin:0 0 16px}.detail.svelte-qwt9km h4.svelte-qwt9km{font-size:var(--sui-font-size-small);font-weight:600;color:var(--sui-secondary-foreground-color)}.detail.svelte-qwt9km h4.svelte-qwt9km,.detail.svelte-qwt9km p.svelte-qwt9km{margin:0 0 4px;word-break:break-all}")}function Dg(t,e,n){const i=t.slice();i[19]=e[n].sha,i[20]=e[n].slug,i[21]=e[n].locales,i[22]=e[n].collectionName,i[23]=e[n].fileName;const s=yi(i[22]);i[24]=s;const l=i[24]._i18n;i[25]=l.defaultLocale!==void 0?l.defaultLocale:"default";const r=i[25]in i[21]?i[25]:Object.keys(i[21])[0];i[26]=r;const o=i[21][i[26]];return i[27]=o.content,i}function Mg(t){let e,n,i,s=t[2]==="image"&&jg(t),l=t[2]==="video"&&Rg(t);return{c(){e=D("div"),s&&s.c(),n=F(),l&&l.c(),E(e,"role","none"),E(e,"class","preview svelte-qwt9km")},m(r,o){S(r,e,o),s&&s.m(e,null),I(e,n),l&&l.m(e,null),i=!0},p(r,o){r[2]==="image"?s?(s.p(r,o),o&4&&m(s,1)):(s=jg(r),s.c(),m(s,1),s.m(e,n)):s&&(H(),v(s,1,1,()=>{s=null}),V()),r[2]==="video"?l?(l.p(r,o),o&4&&m(l,1)):(l=Rg(r),l.c(),m(l,1),l.m(e,null)):l&&(H(),v(l,1,1,()=>{l=null}),V())},i(r){i||(m(s),m(l),i=!0)},o(r){v(s),v(l),i=!1},d(r){r&&y(e),s&&s.d(),l&&l.d()}}}function jg(t){let e,n;return e=new Si({props:{asset:t[0],variant:"tile",checkerboard:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&1&&(l.asset=i[0]),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Rg(t){let e,n;return e=new Nr({props:{asset:t[0],variant:"tile",controls:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&1&&(l.asset=i[0]),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Fg(t){let e,n,i=t[14]("dimensions")+"",s,l,r,o=t[5]?`${t[5].width}×${t[5].height}`:"–",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("dimensions")+"")&&X(s,i),u&32&&o!==(o=c[5]?`${c[5].width}×${c[5].height}`:"–")&&X(a,o)},d(c){c&&y(e)}}}function zg(t){let e,n,i=t[14]("duration")+"",s,l,r,o=(t[6]?Wp(t[6]):"–")+"",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("duration")+"")&&X(s,i),u&64&&o!==(o=(c[6]?Wp(c[6]):"–")+"")&&X(a,o)},d(c){c&&y(e)}}}function g5(t){let e,n;return{c(){e=D("a"),n=K(t[4]),E(e,"href",t[4])},m(i,s){S(i,e,s),I(e,n)},p(i,s){s&16&&X(n,i[4]),s&16&&E(e,"href",i[4])},d(i){i&&y(e)}}}function _5(t){let e;return{c(){e=K("–")},m(n,i){S(n,e,i)},p:q,d(n){n&&y(e)}}}function b5(t){let e,n;return{c(){e=K("/"),n=K(t[3])},m(i,s){S(i,e,s),S(i,n,s)},p(i,s){s&8&&X(n,i[3])},d(i){i&&(y(e),y(n))}}}function v5(t){let e,n,i;return{c(){e=D("a"),n=K("/"),i=K(t[3]),E(e,"href",t[10])},m(s,l){S(s,e,l),I(e,n),I(e,i)},p(s,l){l&8&&X(i,s[3]),l&1024&&E(e,"href",s[10])},d(s){s&&y(e)}}}function Bg(t){let e,n,i=t[14]("sort_keys.commit_author")+"",s,l,r,o=(t[12].name||t[12].login||t[12].email)+"",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("sort_keys.commit_author")+"")&&X(s,i),u&4096&&o!==(o=(c[12].name||c[12].login||c[12].email)+"")&&X(a,o)},d(c){c&&y(e)}}}function Ug(t){let e,n,i=t[14]("sort_keys.commit_date")+"",s,l,r,o=t[11].toLocaleString(t[15])+"",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("sort_keys.commit_date")+"")&&X(s,i),u&34816&&o!==(o=c[11].toLocaleString(c[15])+"")&&X(a,o)},d(c){c&&y(e)}}}function qg(t){let e,n=t[14]("sort_keys.none")+"",i;return{c(){e=D("p"),i=K(n),E(e,"class","svelte-qwt9km")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&16384&&n!==(n=s[14]("sort_keys.none")+"")&&X(i,n)},d(s){s&&y(e)}}}function w5(t){let e=(t[27][t[24].identifier_field]||t[27].title||t[27].name||t[27].label)+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&128&&e!==(e=(i[27][i[24].identifier_field]||i[27].title||i[27].name||i[27].label)+"")&&X(n,e)},d(i){i&&y(n)}}}function k5(t){let e=t[24].files.find(i).label+"",n;function i(...s){return t[16](t[23],...s)}return{c(){n=K(e)},m(s,l){S(s,n,l)},p(s,l){t=s,l&128&&e!==(e=t[24].files.find(i).label+"")&&X(n,e)},d(s){s&&y(n)}}}function y5(t){let e,n=(t[24].label||t[24].name)+"",i,s;function l(a,c){if(a[24].files)return k5;if(a[27])return w5}let r=l(t),o=r&&r(t);return{c(){e=D("span"),i=K(n),s=K(` »
427
+ }`,{input:{branch:{repositoryNameWithOwner:`${i}/${s}`,branchName:l},message:{headline:uO(t,{commitType:e,collection:n})},fileChanges:{additions:r,deletions:o},expectedHeadOid:await Lk()}});return a},XL={label:HL,repository:Do,init:VL,signIn:YL,signOut:GL,fetchFiles:WL,fetchBlob:KL,commitChanges:ZL},JL="Local Repository",Th=Ge(null),fd="root_dir_handle";let nc;const QL=async({forceReload:t=!1}={})=>{if(!("showDirectoryPicker"in window))throw new Error("unsupported");let e=t?void 0:await nc.get(fd);if(e)if(await e.requestPermission({mode:"readwrite"})!=="granted")e=void 0;else try{await e.entries().next()}catch{e=void 0}return e||(e=await window.showDirectoryPicker(),await nc.set(fd,e)),e},xL=async()=>{await nc.delete(fd)},e$=()=>{const{backend:t}=le(Ot);nc=new ud(`${t.name}:${t.repo}`,"file-system-handles")},t$=async()=>(Th.set(await QL()),{backendName:"local"}),n$=async()=>{xL()},Ag=async t=>{const e=Ci(t).split("/"),n=!0;let i=le(Th);for(const s of e)i=await(s.includes(".")?i.getFileHandle(s,{create:n}):i.getDirectoryHandle(s,{create:n}));return i},i$=async()=>{const t=le(Th),e=[],n=[...le(Qd).map(({file:r,folder:o})=>r??o),...le(_i).map(({internalPath:r})=>r)].map(r=>Ci(r)),i=r=>new RegExp(`^${Vt(r)}\\b`),s=n.map(i),l=async r=>{for await(const[o,a]of r.entries()){if(o.startsWith("."))continue;const c=(await t.resolve(a)).join("/"),u=s.some(f=>c.match(f));if(a.kind==="file"){if(!u)continue;try{const f=await a.getFile();e.push({file:f,path:c,name:o,sha:await Fa(f),size:f.size,text:o.match(/\.(?:json|markdown|md|toml|ya?ml)$/i)?await eO(f):null})}catch(f){console.error(f)}}if(a.kind==="directory"){const f=i(c);if(!u&&!n.some(d=>d.match(f)))continue;await l(a)}}};return await l(t),e},s$=async()=>{const{entryFiles:t,assetFiles:e}=cd(await i$());ni.set(Ok(t)),an.set(Ak(e)),fo.set(!0)},l$=async t=>{await Promise.all(t.map(async({action:e,path:n,data:i})=>{try{if(["create","update"].includes(e)){const l=await(await Ag(n)).createWritable();await l.write(i),await l.close()}if(e==="delete"){const[,s,l]=Ci(n).match(/(.+)\/([^/]+)$/);await(await Ag(s)).removeEntry(l)}}catch(s){console.error(s)}}))},r$={label:JL,init:e$,signIn:t$,signOut:n$,fetchFiles:s$,commitChanges:l$},$k={github:XL,local:r$},Mo=Ge(),bi=pn([Mo],([t],e)=>{const n=$k[t];n?.init(),e(n)}),Fi=Ge();Fi.subscribe(t=>{(async()=>{try{t?await sn.set("sveltia-cms.user",t):t===null&&await sn.delete("sveltia-cms.user")}catch{}})()});const Nk=Ge(""),ic=Ge(!1),dd=t=>{Nk.set(t.cause?.message||le(me)("unexpected_error")),console.error(t.message,t.cause)},o$=async()=>{const t=await sn.get("sveltia-cms.user")||await sn.get("decap-cms-user")||await sn.get("netlify-cms-user"),e=ji(t)&&t.backendName?t:{},n=!!window.location.hostname.match(/^(?:.+\.)?localhost$/),i=e.backendName?.replace("proxy","local")??(n?"local":le(Ot).backend?.name);if(Mo.set(i),i!=="local"&&le(bi)&&e.token&&!le(ic)){Fi.set(e);try{await le(bi).fetchFiles()}catch(s){[401,403].includes(s.cause?.status)?ic.set(!0):dd(s)}}},Lg=async(t="")=>{let e;try{e=await le(bi).signIn(t)}catch(n){dd(n);return}Fi.set(e);try{await le(bi).fetchFiles()}catch(n){dd(n)}};function a$(t){pe(t,"svelte-8a6wia",".buttons.svelte-8a6wia{display:flex;flex-direction:column;align-items:center;gap:16px}.buttons.svelte-8a6wia button{width:240px}")}function c$(t){let e,n=t[1]("config.error.unsupported_backend",{values:{name:t[0]}})+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&3&&n!==(n=s[1]("config.error.unsupported_backend",{values:{name:s[0]}})+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function u$(t){let e,n;return e=new Ye({props:{variant:"primary",label:t[1]("sign_in_with_x",{values:{service:t[2].label}})}}),e.$on("click",t[5]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&6&&(l.label=i[1]("sign_in_with_x",{values:{service:i[2].label}})),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function f$(t){let e,n,i,s;const l=[h$,d$],r=[];function o(a,c){return"showDirectoryPicker"in window?1:0}return e=o(),n=r[e]=l[e](t),{c(){n.c(),i=x()},m(a,c){r[e].m(a,c),S(a,i,c),s=!0},p(a,c){n.p(a,c)},i(a){s||(m(n),s=!0)},o(a){v(n),s=!1},d(a){a&&y(i),r[e].d(a)}}}function d$(t){let e,n;return e=new Ye({props:{variant:"primary",label:t[1]("work_with_local_repo")}}),e.$on("click",t[4]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&2&&(l.label=i[1]("work_with_local_repo")),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function h$(t){let e,n=t[1]("unsupported.browser")+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&2&&n!==(n=s[1]("unsupported.browser")+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function m$(t){let e,n,i,s;const l=[f$,u$,c$],r=[];function o(a,c){return a[0]==="local"?0:a[2]||a[3]?1:2}return n=o(t),i=r[n]=l[n](t),{c(){e=D("div"),i.c(),E(e,"role","none"),E(e,"class","buttons svelte-8a6wia")},m(a,c){S(a,e,c),r[n].m(e,null),s=!0},p(a,[c]){let u=n;n=o(a),n===u?r[n].p(a,c):(H(),v(r[u],1,1,()=>{r[u]=null}),V(),i=r[n],i?i.p(a,c):(i=r[n]=l[n](a),i.c()),m(i,1),i.m(e,null))},i(a){s||(m(i),s=!0)},o(a){v(i),s=!1},d(a){a&&y(e),r[n].d()}}}function p$(t,e,n){let i,s,l,r;return B(t,Mo,c=>n(0,i=c)),B(t,me,c=>n(1,s=c)),B(t,bi,c=>n(2,l=c)),B(t,ic,c=>n(3,r=c)),ln(()=>{o$()}),[i,s,l,r,async()=>{await Lg()},async()=>{await Lg()}]}class g$ extends ie{constructor(e){super(),ne(this,e,p$,m$,te,{},a$)}}const xr=Ge({saved:!1,deleted:!1,count:1}),Pk=async t=>{const e=le(ni),n=t.map(i=>{const{locales:s,slug:l}=e.find(r=>r.id===i)??{};if(s)return Object.values(s).map(({path:r})=>({action:"delete",slug:l,path:r}))}).flat(1).filter((i,s,l)=>i&&l.findIndex(r=>r.path===i.path)===s);await le(bi).commitChanges(n,{commitType:"delete",collection:le(Rt)}),ni.set(e.filter(i=>!t.includes(i.id))),xr.set({deleted:!0,count:t.length})},_$="deepl",b$="DeepL",v$="https://www.deepl.com/pro-api",w$="https://www.deepl.com/account/summary",k$=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?::fx)?/,y$=["BG,CS,DA,DE,EL,EN,ES,ET,FI,FR,HU,ID,IT,JA,KO,LT,LV,NB,NL,PL,PT,RO,RU,SK,SL,SV,TR,UK,ZH"].join(",").split(","),S$=["BG,CS,DA,DE,EL,EN,EN-GB,EN-US,ES,ET,FI,FR,HU,ID,IT,JA,KO,LT,LV,NB,NL,PL,PT,PT-BR,PT-PT,RO,RU,SK","SL,SV,TR,UK,ZH"].join(",").split(","),T$=async(t,{sourceLocale:e="",targetLocale:n,apiKey:i})=>{const s=new URLSearchParams([...t.map(a=>["text",a]),["source_lang",e.toUpperCase()],["target_lang",n.toUpperCase()],["tag_handling","html"],["split_sentences","1"],["auth_key",i]]),r=`https://${i.endsWith(":fx")?"api-free.deepl.com":"api.deepl.com"}/v2/translate?${s.toString()}`,{translations:o}=await fetch(r).then(a=>a.json());return o.map(a=>a.text)},Ik={serviceId:_$,serviceLabel:b$,developerURL:v$,apiKeyURL:w$,apiKeyPattern:k$,sourceLanguages:y$,targetLanguages:S$,translate:T$},$g={deepl:Ik},sc=Ge(Ik),Jl=Ge(!1),eo=Ge(),hd="sveltia-cms.entry-view",sl=Ge(null),ws=Ge(null),jo=Ge({}),Di=Ge({},t=>{(async()=>{try{const e={showPreview:!0,syncScrolling:!0,selectAssetsView:{type:"grid"},...await sn.get(hd)??{}};t(e),jo.set(e.selectAssetsView)}catch{}})()}),Je=Ge(),Xc=(t,e={})=>{const n={},i=({fieldConfig:s,keyPath:l})=>{if(l in e){n[l]=e[l];return}const{widget:r,default:o,required:a=!0}=s,c=Array.isArray(o)&&!!o.length;if(r==="list"){const{fields:u}=s;if(!c){n[l]=[];return}if(u){o.forEach((f,d)=>{Object.entries(f).forEach(([h,_])=>{n[[l,d,h].join(".")]=_})});return}o.forEach((f,d)=>{n[[l,d].join(".")]=f});return}if(r==="object"){if(!a)return;const{fields:u}=s;u.forEach(f=>{i({keyPath:[l,f.name].join("."),fieldConfig:f})});return}if(r==="boolean"){n[l]=typeof o=="boolean"?o:!1;return}if(r==="relation"||r==="select"){const{multiple:u=!1}=s;if(u){n[l]=c?o:[];return}}if(r==="date"||r==="datetime"){if(typeof o=="string")n[l]=o;else{const{date_format:u,time_format:f,picker_utc:d=!1}=s,{year:h,month:_,day:p,hour:b,minute:g}=Bc({timeZone:d?"UTC":void 0});f===!1?n[l]=`${h}-${_}-${p}`:u===!1?n[l]=`${b}:${g}`:n[l]=`${h}-${_}-${p}T${b}:${g}${d?"Z":""}`}return}n[l]=o!==void 0?o:""};return t.forEach(s=>{i({keyPath:s.name,fieldConfig:s})}),n},gr=({draft:{collectionName:t,fileName:e},prop:n="currentValues",locale:i,target:s={},getValueMap:l=void 0})=>{const r=yi(t),{defaultLocale:o="default"}=r._i18n;return new Proxy(s,{set:(a,c,u)=>{const f=typeof l=="function"?l():a,d=ri({collectionName:t,fileName:e,valueMap:f,keyPath:c});return d?(d.i18n==="duplicate"&&i===o&&Object.entries(le(Je)[n]).forEach(([h,_])=>{if(c.includes(".")){const[,p]=c.match(/(.+)\.[^.]+$/);if(!Object.keys(_).some(b=>b.startsWith(`${p}.`)))return}h!==i&&_[c]!==u&&(_[c]=u)}),Reflect.set(a,c,u)):!0}})},oa=(t,e)=>{const{id:n,collectionName:i,fileName:s,locales:l}=t,r=n===void 0,o=yi(i),{hasLocales:a,locales:c}=o._i18n,u=s?o.files?.find(({name:g})=>g===s):void 0,{fields:f}=u??o,d=Xc(f,e),h=a?c:["default"],_=r?h:h.filter(g=>!!l?.[g]?.content),p=Object.fromEntries(h.map(g=>[g,r||_.includes(g)])),b=Object.fromEntries(_.map(g=>[g,r?d:Mi(l?.[g].content)]));Je.set({isNew:r&&!s,collectionName:i,collection:o,fileName:s,collectionFile:u,originalEntry:r?void 0:t,originalLocales:p,currentLocales:structuredClone(p),originalValues:b,currentValues:Object.fromEntries(_.map(g=>[g,a?gr({draft:{collectionName:i,fileName:s},locale:g,target:structuredClone(b[g])}):structuredClone(b[g])])),files:Object.fromEntries(_.map(g=>[g,a?gr({draft:{collectionName:i,fileName:s},prop:"files",locale:g,getValueMap:()=>le(Je).currentValues[g]}):{}])),validities:Object.fromEntries(h.map(g=>[g,{}])),viewStates:Object.fromEntries(h.map(g=>[g,{}]))})},Ng=t=>ol(JSON.parse(JSON.stringify(t))),Pg=(t,e)=>e.split(".").reduce((n,i)=>{const s=i.match(/^\d+$/)?Number(i):i;return n[s]||=[],n[s]},t),Ck=(t,e,n)=>{const i=Ng(le(Je).currentValues[t]),s=Ng(le(Je).viewStates[t]);n({valueList:Pg(i,e),viewList:Pg(s,e)}),Je.update(l=>({...l,currentValues:{...l.currentValues,[t]:gr({draft:l,locale:t,target:Mi(i)})},viewStates:{...l.viewStates,[t]:Mi(s)}}))},md=(t,{prop:e="currentValues"}={})=>{const n=le(Je),{collectionName:i,fileName:s,collection:{_i18n:{defaultLocale:l="default"}}}=n,r=n[e][l],o=[...new Set([...Object.keys(t),...Object.keys(r)])],a={};return o.forEach(c=>{const u=ri({collectionName:i,fileName:s,keyPath:c})?.i18n==="duplicate";a[c]=(u?r[c]:void 0)??t[c]}),a},Dk=t=>{Je.update(e=>{const{currentLocales:n,currentValues:i}=e,s=!n[t];if(s&&!i[t]){const{collection:l,collectionName:r,collectionFile:o,fileName:a,originalValues:c,files:u}=e,{fields:f}=o??l,d=Xc(f),{_i18n:{defaultLocale:h="default"}}=l;return{...e,currentLocales:{...n,[t]:s},originalValues:{...c,[t]:d},currentValues:{...i,[t]:gr({draft:{collectionName:r,fileName:a},locale:t,target:md(d)})},files:{...u,[t]:gr({draft:{collectionName:r,fileName:a},prop:"files",locale:t,target:md(Object.fromEntries(Object.keys(u[h]).map(_=>[_,void 0])),{prop:"files"}),getValueMap:()=>le(Je).currentValues[t]})}}}return{...e,currentLocales:{...n,[t]:s}}})},pd=Ge({id:void 0,show:!1,status:void 0,message:void 0,count:1,sourceLocale:void 0}),Mk=async(t,e,n="",i=!1)=>{const{collectionName:s,fileName:l,currentValues:r}=le(Je),o=r[t],a=Object.fromEntries(Object.entries(o).filter(([h,_])=>{const p=ri({collectionName:s,fileName:l,valueMap:o,keyPath:h});return!(n&&!h.startsWith(n)||typeof _!="string"||!["markdown","text","string","list"].includes(p?.widget)||p?.widget==="list"&&(p.field??p.fields)||!i&&_===r[e][h])})),c=Object.keys(a).length,u=c===1?"one":"many",f=i?"translation":"copy",d=(h,_)=>{pd.set({id:Date.now(),show:!0,status:h,message:_,count:c,sourceLocale:t})};if(!c){d("info",`${f}.none`);return}if(i){const h=le(vt).apiKeys?.[le(sc)?.serviceId];if(!h)return;d("info","translation.started");try{const _=await le(sc).translate(Object.values(a),{apiKey:h,sourceLocale:t,targetLocale:e});Object.keys(a).forEach((p,b)=>{r[e][p]=_[b]}),d("success",`translation.complete.${u}`)}catch{d("error","translation.error")}}else Object.entries(a).forEach(([h,_])=>{r[e][h]=_}),d("success",`copy.complete.${u}`);Je.update(h=>({...h,currentValues:r}))},Eh=(t="",e="")=>{const{collection:n,fileName:i,currentValues:s,originalValues:l}=le(Je),{hasLocales:r,locales:o,defaultLocale:a="default"}=n._i18n,c=t?[t]:r?o:["default"],u=(f,d,h=!1)=>{Object.entries(d).forEach(([_,p])=>{if(!e||_.startsWith(e)){const b=ri({collectionName:n.name,fileName:i,valueMap:d,keyPath:_});(f===a||[!0,"translate"].includes(b?.i18n))&&(h?delete s[f][_]:s[f][_]=p)}})};c.forEach(f=>{u(f,s[f],!0),u(f,l[f],!1)}),Je.update(f=>({...f,currentValues:s}))},E$=()=>{const{collection:t,fileName:e,currentLocales:n,currentValues:i,validities:s}=le(Je),{hasLocales:l,defaultLocale:r="default"}=t._i18n;let o=!0;return Object.entries(i).forEach(([a,c])=>{const u=Object.entries(c);if(!n[a]){s[a]=Object.fromEntries(u.map(([f])=>[f,{valid:!0}]));return}s[a]={},u.forEach(([f,d])=>{const h=ri({collectionName:t.name,fileName:e,valueMap:c,keyPath:f});if(!h)return;const _=f.match(/\.(\d+)$/),{widget:p,required:b=!0,i18n:g=!1,pattern:w}=h,{multiple:k=!1}=h,{min:T,max:P}=h,R=b!==!1&&(a===r||l&&g!==!1);let z=!1,$=!1,C=!1,M=!1;if(_){if(Number(_[1])>0)return;f=f.replace(/\.\d+$/,"");const Z=new RegExp(`^${Vt(f)}\\.\\d+$`),G=u.filter(([Pe])=>Pe.match(Z)).map(([,Pe])=>Pe).filter(Pe=>Pe!==void 0)??[];R&&!G.length&&(z=!0),typeof T=="number"&&Array.isArray(d)&&d.length<T&&($=!0),typeof P=="number"&&Array.isArray(d)&&d.length>P&&(C=!0)}p==="list"&&Array.isArray(d)&&(typeof T=="number"&&d.length<T?$=!0:R&&!d.length&&(z=!0)),["object","list"].includes(p)||(R&&(d===void 0||d===""||k&&!d.length)&&(z=!0),Array.isArray(w)&&w.length===2&&!String(d).match(Vt(w[0]))&&(M=!0));const j={valueMissing:z,rangeUnderflow:$,rangeOverflow:C,patternMismatch:M},Q=!Object.values(j).some(Boolean);s[a][f]={...j,valid:Q},Q||(o=!1)})}),Je.update(a=>({...a,validities:s})),o},Ig=(t,e,n)=>{const{collection:i,collectionFile:s,originalEntry:l,currentValues:r}=t;if(s)return s.file;if(l?.locales[e])return l?.locales[e].path;const{structure:o,defaultLocale:a}=i._i18n,c=i.folder?.replace(/\/$/,""),u=i.path?ho(i.path,{collection:i,content:r[a],currentSlug:n}):n,f=yh({format:i.format,extension:i.extension}),d=`${c}/${u}.${f}`,h={multiple_folders:`${c}/${e}/${u}.${f}`,multiple_files:`${c}/${u}.${e}.${f}`,single_file:d};return h[o]||h.single_file},O$=async()=>{if(!E$())throw new Error("validation_failed");const t=le(Fi),e=le(Je),{collection:n,isNew:i,originalLocales:s,currentLocales:l,originalEntry:r,collectionName:o,collectionFile:a,fileName:c,currentValues:u,files:f}=e,{identifier_field:d="title",slug:h=`{{${d}}}`,_i18n:{structure:_,hasLocales:p,locales:b,defaultLocale:g="default"}}=n,w={collection:n,content:u[g]},k=c||r?.slug||ho(h,w),{internalAssetFolder:T,publicAssetFolder:P}=lO(n,{...w,currentSlug:k,isMediaFolder:!0,entryFilePath:Ig(e,g,k)}),N=le(an).map(U=>U.path).filter(U=>U.match(`^\\/${Vt(T)}\\/[^\\/]+$`)),R=[],z=[],$={text:void 0,collectionName:o,folder:T,commitAuthor:t.email?{name:t.name,email:t.email}:void 0,commitDate:new Date},C=Object.fromEntries(await Promise.all(Object.entries(u).map(async([U,J])=>{const Ce=Ig(e,U,k);if(!l[U])return[U,{path:Ce}];for(const[He,ee]of Object.entries(J)){if(ee===void 0){delete J[He];continue}if(typeof ee!="string")continue;J[He]=ee.trim();const[,kt,Be]=ee.match(/^data:(.+?\/.+?);base64,(.+)/)??[];if(kt){const Kt=f[U][He]||await(async()=>{const Et=await(await fetch(ee)).blob(),[Yt,Bt]=kt.split("/"),[ds]=Bt.split("+");return new File([Et],`${Yt}-${Date.now()}.${ds}`,{type:kt})})(),Xe=await Fa(Kt),bn=z.find(Ft=>Ft.sha===Xe);if(bn){J[He]=P?`${P}/${bn.name}`:bn.name;continue}const Mt=eh(Kt.name,[...N,...z.map(Ft=>Ft.name)]),ci=`${T}/${Mt}`;R.push({action:"create",path:ci,data:Kt,base64:Be}),z.push({...$,url:URL.createObjectURL(Kt),name:Mt,path:ci,sha:Xe,size:Kt.size,kind:th(Mt)}),J[He]=P?`${P}/${Mt}`:Mt}}const we=ol(J),mt=await Fa(new Blob([we],{type:"text/plain"}));return[U,{content:we,sha:mt,path:Ce}]}))),M={id:`${o}/${k}`,collectionName:o,fileName:c,slug:k,sha:C[g].sha,locales:Object.fromEntries(Object.entries(C).filter(([,{content:U}])=>!!U))},{extension:j,format:Q,frontmatter_delimiter:de,yaml_quote:Z}=n,G={extension:j,format:Q,frontmatterDelimiter:de,yamlQuote:Z};if(a||!p||_==="single_file"){const{path:U,content:J}=C[g];R.push({action:i?"create":"update",slug:k,path:U,data:Og({content:p?Object.fromEntries(Object.entries(C).map(([Ce,we])=>[Ce,we.content])):J,path:U,config:G})})}else b.forEach(U=>{const{path:J,content:Ce}=C[U];l[U]?R.push({action:i||!s[U]?"create":"update",slug:k,path:J,data:Og({content:Ce,path:J,config:G})}):s[U]&&R.push({action:"delete",slug:k,path:J})});try{await le(bi).commitChanges(R,{commitType:i?"create":"update",collection:n})}catch{throw new Error("saving_failed")}const Pe=z.map(U=>U.path);ni.update(U=>[...U.filter(J=>J.id!==M.id),M]),an.update(U=>[...U.filter(J=>!Pe.includes(J.path)),...z]),Je.set(null),xr.set({saved:!0,count:1})};Je.subscribe(t=>{le(vt).devModeEnabled&&console.info("entryDraft",t)});jo.subscribe(t=>{const e=le(Di).selectAssetsView??{};jn(t,e)||Di.update(n=>({...n,selectAssetsView:t}))});Di.subscribe(t=>{!t||!Object.keys(t).length||(async()=>{try{jn(t,await sn.get(hd))||await sn.set(hd,t)}catch{}})()});const jk=pn([Je,el],([t,e],n)=>{n(!!(t||e))}),Sa=Ge(""),In=Ge(""),Ro=(t=window.location)=>{const{pathname:e,searchParams:n}=new URL(`${t.origin}${t.hash.substring(1)}`);return{path:decodeURIComponent(e),params:Object.fromEntries([...n.entries()])}},mn=(t,{state:e={},replaceState:n=!1,notifyChange:i=!0}={})=>{const s=window.location.hash,l=`#${t}`,r=[{...e,from:s},"",l];n?window.history.replaceState(...r):window.history.pushState(...r),i&&window.dispatchEvent(new HashChangeEvent("hashchange",{oldURL:s,newURL:l}))},Ql=(t,e={})=>{window.history.state?.from?window.history.back():mn(t,e)},Rk=()=>{const{display_url:t,site_url:e}=le(Ot);window.open(t||e||"/","_blank")};function A$(t){pe(t,"svelte-1vpdavd",".container.svelte-1vpdavd.svelte-1vpdavd.svelte-1vpdavd{position:fixed;inset:32px;display:flex;justify-content:center;align-items:center;gap:16px}.container.svelte-1vpdavd .inner.svelte-1vpdavd.svelte-1vpdavd{display:flex;flex-direction:column;align-items:center;gap:32px;min-width:240px;max-width:800px;height:240px}.container.svelte-1vpdavd .logo.svelte-1vpdavd.svelte-1vpdavd{max-width:160px;height:auto}.container.svelte-1vpdavd h1.svelte-1vpdavd.svelte-1vpdavd{font-size:48px}.container.svelte-1vpdavd .logo.svelte-1vpdavd~h1.svelte-1vpdavd{font-size:var(--sui-font-size-xxx-large)}.container.svelte-1vpdavd .message.svelte-1vpdavd.svelte-1vpdavd{margin:0 0 16px;font-size:var(--sui-font-size-large);font-weight:normal;text-align:center}.container.svelte-1vpdavd .error.svelte-1vpdavd.svelte-1vpdavd{border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);line-height:1.5;text-align:center}")}function L$(t){let e,n=t[0]("loading_site_data")+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&1&&n!==(n=s[0]("loading_site_data")+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function $$(t){let e,n;return e=new g$({}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function N$(t){let e,n,i=t[0]("loading_site_data_error")+"",s,l,r,o=On.sanitize(at.parseInline(t[3]),{ALLOWED_TAGS:["a","code"],ALLOWED_ATTR:["href"]})+"";return{c(){e=D("div"),n=D("div"),s=K(i),l=F(),r=D("div"),E(n,"role","none"),E(n,"class","message svelte-1vpdavd"),E(r,"role","none"),E(r,"class","error svelte-1vpdavd"),E(e,"role","alert")},m(a,c){S(a,e,c),I(e,n),I(n,s),I(e,l),I(e,r),r.innerHTML=o},p(a,c){c&1&&i!==(i=a[0]("loading_site_data_error")+"")&&X(s,i),c&8&&o!==(o=On.sanitize(at.parseInline(a[3]),{ALLOWED_TAGS:["a","code"],ALLOWED_ATTR:["href"]})+"")&&(r.innerHTML=o)},i:q,o:q,d(a){a&&y(e)}}}function P$(t){let e,n=t[0](`prefs.error.${t[2].error}`)+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&5&&n!==(n=s[0](`prefs.error.${s[2].error}`)+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function I$(t){let e,n=t[1].error+"",i,s,l=t[0]("config.error.try_again")+"",r;return{c(){e=D("div"),i=K(n),s=F(),r=K(l),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(o,a){S(o,e,a),I(e,i),I(e,s),I(e,r)},p(o,a){a&2&&n!==(n=o[1].error+"")&&X(i,n),a&1&&l!==(l=o[0]("config.error.try_again")+"")&&X(r,l)},i:q,o:q,d(o){o&&y(e)}}}function C$(t){let e,n=t[0]("loading_site_config")+"",i;return{c(){e=D("div"),i=K(n),E(e,"role","alert"),E(e,"class","message svelte-1vpdavd")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&1&&n!==(n=s[0]("loading_site_config")+"")&&X(i,n)},i:q,o:q,d(s){s&&y(e)}}}function D$(t){let e,n,i,s,l,r,o,a,c,u;const f=[C$,I$,P$,N$,$$,L$],d=[];function h(_,p){return!_[1]||!_[2]?0:_[1].error?1:_[2].error?2:_[3]?3:!_[4]||_[5]?4:_[6]?-1:5}return~(a=h(t))&&(c=d[a]=f[a](t)),{c(){e=D("div"),n=D("div"),i=D("img"),l=F(),r=D("h1"),r.textContent="Sveltia CMS",o=F(),c&&c.c(),E(i,"loading","lazy"),gi(i.src,s=t[1]?.logo_url||`data:image/svg+xml;base64,${btoa(Of)}`)||E(i,"src",s),E(i,"alt",""),E(i,"class","logo svelte-1vpdavd"),E(r,"class","svelte-1vpdavd"),E(n,"role","none"),E(n,"class","inner svelte-1vpdavd"),E(e,"role","none"),E(e,"class","container svelte-1vpdavd")},m(_,p){S(_,e,p),I(e,n),I(n,i),I(n,l),I(n,r),I(n,o),~a&&d[a].m(n,null),u=!0},p(_,[p]){(!u||p&2&&!gi(i.src,s=_[1]?.logo_url||`data:image/svg+xml;base64,${btoa(Of)}`))&&E(i,"src",s);let b=a;a=h(_),a===b?~a&&d[a].p(_,p):(c&&(H(),v(d[b],1,1,()=>{d[b]=null}),V()),~a?(c=d[a],c?c.p(_,p):(c=d[a]=f[a](_),c.c()),m(c,1),c.m(n,null)):c=null)},i(_){u||(m(c),u=!0)},o(_){v(c),u=!1},d(_){_&&y(e),~a&&d[a].d()}}}function M$(t,e,n){let i,s,l,r,o,a,c,u;return B(t,me,f=>n(0,i=f)),B(t,In,f=>n(7,s=f)),B(t,Ot,f=>n(1,l=f)),B(t,vt,f=>n(2,r=f)),B(t,Nk,f=>n(3,o=f)),B(t,Fi,f=>n(4,a=f)),B(t,ic,f=>n(5,c=f)),B(t,fo,f=>n(6,u=f)),ln(()=>{Q8()}),t.$$.update=()=>{t.$$.dirty&1&&$e(In,s=i("welcome_to_sveltia_cms"),s)},[i,l,r,o,a,c,u]}class j$ extends ie{constructor(e){super(),ne(this,e,M$,D$,te,{},A$)}}const gd="sveltia-cms.assets-view",R$=(t,e,n)=>e==="eager"?mo(t):new Promise(i=>{const s=new IntersectionObserver(([l])=>{l.isIntersecting&&(s.disconnect(),i(mo(t)))});s.observe(n)}),to=t=>t==="*"?le(me)("all_assets"):t?le(Ot).collections.find(({name:e})=>e===t)?.label??"":le(me)("uncategorized"),_r=t=>{const{media_folder:e}=le(Ot);if(!t)return to("*");if(t===e)return to(void 0);const n=le(_i).find(({internalPath:i})=>i===t);return n?to(n.collectionName):""},F$=(t,{key:e,order:n}={})=>{if(!e||!n)return t;const i=[...t],s={commit_author:String,commit_date:Date}[e]||i[0]?.[e]?.constructor||String,l=r=>{const{commitAuthor:{name:o,login:a,email:c}={},commitDate:u}=r;return e==="commit_author"?o||a||c:e==="commit_date"?u:e==="name"?r.name.split(".")[0]:r[e]??""};return i.sort((r,o)=>{const a=l(r),c=l(o);return s===String?a.localeCompare(c):s===Date?Number(a)-Number(c):a-c}),n==="descending"&&i.reverse(),i},z$=(t,{field:e,pattern:n}={field:void 0,pattern:void 0})=>{if(!e)return t;if(e==="fileType")return t.filter(({path:s})=>n==="other"?!Object.values(jf).some(l=>s.match(l)):s.match(jf[n]));const i=typeof n=="string"?new RegExp(n):void 0;return t.filter(s=>{const l=s[e];return i?String(l??"").match(i):l===n})},B$=(t,{field:e,pattern:n}={field:void 0,pattern:void 0})=>{if(!e)return t.length?{"*":t}:{};const i=typeof n=="string"?new RegExp(n):void 0,s={},l=le(me)("other");return t.forEach(r=>{const o=r[e];let a;i?[a=l]=String(o??"").match(i)??[]:a=o,a in s||(s[a]=[]),s[a].push(r)}),Object.fromEntries(Object.entries(s).sort(([r],[o])=>r.localeCompare(o)))},U$={type:"grid",sort:{key:"name",order:"ascending"}},Vn=Ge({}),lc=Ge({},t=>{(async()=>{try{t(await sn.get(gd)??{}),mi.subscribe(e=>{const n=le(lc)[e||"*"]??structuredClone(U$);jn(n,le(Vn))||Vn.set(n)})}catch{}})()}),q$=pn([an,xt],([t],e)=>{const{commitAuthor:n,commitDate:i}=t?.[0]??{},s=["name"];n&&s.push("commit_author"),i&&s.push("commit_date"),e(s.map(l=>({key:l,label:le(me)(`sort_keys.${l}`)})))}),gl=pn([an,mi],([t,e],n)=>{n(t&&e?t.filter(({folder:i})=>e===i):t?[...t]:[])}),Fk=pn([gl,Vn],([t,e],n)=>{let i=[...t];i=F$(i,e?.sort),i=z$(i,e?.filter),n(B$(i,e?.group))});gl.subscribe(t=>{xs.set([]),le(vt).devModeEnabled&&console.info("listedAssets",t)});Vn.subscribe(t=>{const e=le(mi)||"*",n=le(lc)[e]??{};jn(t,n)||lc.update(i=>({...i,[e]:t}))});lc.subscribe(t=>{!t||!Object.keys(t).length||(async()=>{try{jn(t,await sn.get(gd))||await sn.set(gd,t)}catch{}})()});const no=Ge({saved:!1,deleted:!1,count:1}),H$=async({files:t,folder:e},n)=>{const i=le(an).map(o=>o.path).filter(o=>o.match(`^${Vt(e)}\\/[^\\/]+$`)).map(o=>o.split("/").pop()),s=t.map(o=>{const a=eh(o.name,i),c=[e,a].join("/");return i.push(a),{name:a,path:c,file:o}});await le(bi).commitChanges(s.map(({path:o,file:a})=>({action:"create",path:o,data:a})),n);const{collectionName:l=null}=le(_i).findLast(({internalPath:o})=>e===o)??{},r=await Promise.all(s.map(async({name:o,path:a,file:c})=>({url:URL.createObjectURL(c),name:o,path:a,sha:await Fa(c),size:c.size,kind:th(o),text:null,collectionName:l,folder:e})));an.update(o=>[...o.filter(a=>!r.some(c=>c.path===a.path)),...r]),no.set({saved:!0,count:t.length})},V$=async t=>{await le(bi).commitChanges(t.map(({path:e})=>({action:"delete",path:e})),{commitType:"deleteMedia"}),an.update(e=>e.filter(n=>!t.includes(n))),no.set({deleted:!0,count:t.length})};function Y$(t){let e=t[3]("confirm_deleting_selected_assets",{values:{count:t[2].length}})+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&12&&e!==(e=i[3]("confirm_deleting_selected_assets",{values:{count:i[2].length}})+"")&&X(n,e)},d(i){i&&y(n)}}}function G$(t){let e=t[3]("confirm_deleting_all_assets")+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&8&&e!==(e=i[3]("confirm_deleting_all_assets")+"")&&X(n,e)},d(i){i&&y(n)}}}function W$(t){let e=t[3]("confirm_deleting_selected_asset")+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&8&&e!==(e=i[3]("confirm_deleting_selected_asset")+"")&&X(n,e)},d(i){i&&y(n)}}}function K$(t){let e;return{c(){e=K(t[1])},m(n,i){S(n,e,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&y(e)}}}function Z$(t){let e;function n(l,r){return l[1]?K$:l[2].length===1?W$:l[2].length===l[4].length?G$:Y$}let i=n(t),s=i(t);return{c(){s.c(),e=x()},m(l,r){s.m(l,r),S(l,e,r)},p(l,r){i===(i=n(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function X$(t){let e,n,i;function s(r){t[6](r)}let l={title:t[2].length===1?t[3]("delete_asset"):t[3]("delete_assets"),okLabel:t[3]("delete"),$$slots:{default:[Z$]},$$scope:{ctx:t}};return t[0]!==void 0&&(l.open=t[0]),e=new Oo({props:l}),ae.push(()=>De(e,"open",s)),e.$on("ok",t[7]),{c(){L(e.$$.fragment)},m(r,o){O(e,r,o),i=!0},p(r,[o]){const a={};o&12&&(a.title=r[2].length===1?r[3]("delete_asset"):r[3]("delete_assets")),o&8&&(a.okLabel=r[3]("delete")),o&286&&(a.$$scope={dirty:o,ctx:r}),!n&&o&1&&(n=!0,a.open=r[0],je(()=>n=!1)),e.$set(a)},i(r){i||(m(e.$$.fragment,r),i=!0)},o(r){v(e.$$.fragment,r),i=!1},d(r){A(e,r)}}}function J$(t,e,n){let i,s;B(t,me,f=>n(3,i=f)),B(t,gl,f=>n(4,s=f));let{open:l=!1}=e,{description:r=""}=e,{assets:o=[]}=e;const a=Ms();function c(f){l=f,n(0,l)}const u=()=>{V$(o),a("delete")};return t.$$set=f=>{"open"in f&&n(0,l=f.open),"description"in f&&n(1,r=f.description),"assets"in f&&n(2,o=f.assets)},[l,r,o,i,s,a,c,u]}class zk extends ie{constructor(e){super(),ne(this,e,J$,X$,te,{open:0,description:1,assets:2})}}function Q$(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"arrow_back_ios_new"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function x$(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"delete"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function e5(t){let e,n,i,s=t[3].name+"",l,r,o,a,c,u;return e=new Ye({props:{variant:"ghost",iconic:!0,"aria-label":t[1]("cancel_editing"),$$slots:{"start-icon":[Q$]},$$scope:{ctx:t}}}),e.$on("click",t[4]),o=new En({props:{flex:!0}}),c=new Ye({props:{variant:"secondary",label:t[1]("delete"),"aria-label":t[1]("delete_asset"),$$slots:{"start-icon":[x$]},$$scope:{ctx:t}}}),c.$on("click",t[5]),{c(){L(e.$$.fragment),n=F(),i=D("h2"),l=K(s),r=F(),L(o.$$.fragment),a=F(),L(c.$$.fragment),E(i,"role","none")},m(f,d){O(e,f,d),S(f,n,d),S(f,i,d),I(i,l),S(f,r,d),O(o,f,d),S(f,a,d),O(c,f,d),u=!0},p(f,d){const h={};d&2&&(h["aria-label"]=f[1]("cancel_editing")),d&256&&(h.$$scope={dirty:d,ctx:f}),e.$set(h),(!u||d&8)&&s!==(s=f[3].name+"")&&X(l,s);const _={};d&2&&(_.label=f[1]("delete")),d&2&&(_["aria-label"]=f[1]("delete_asset")),d&256&&(_.$$scope={dirty:d,ctx:f}),c.$set(_)},i(f){u||(m(e.$$.fragment,f),m(o.$$.fragment,f),m(c.$$.fragment,f),u=!0)},o(f){v(e.$$.fragment,f),v(o.$$.fragment,f),v(c.$$.fragment,f),u=!1},d(f){f&&(y(n),y(i),y(r),y(a)),A(e,f),A(o,f),A(c,f)}}}function t5(t){let e,n,i,s,l;e=new Rs({props:{variant:"primary","aria-label":t[1]("primary"),$$slots:{default:[e5]},$$scope:{ctx:t}}});function r(a){t[6](a)}let o={description:t[1]("confirm_deleting_this_asset"),assets:[t[3]]};return t[0]!==void 0&&(o.open=t[0]),i=new zk({props:o}),ae.push(()=>De(i,"open",r)),i.$on("delete",t[7]),{c(){L(e.$$.fragment),n=F(),L(i.$$.fragment)},m(a,c){O(e,a,c),S(a,n,c),O(i,a,c),l=!0},p(a,[c]){const u={};c&2&&(u["aria-label"]=a[1]("primary")),c&271&&(u.$$scope={dirty:c,ctx:a}),e.$set(u);const f={};c&2&&(f.description=a[1]("confirm_deleting_this_asset")),c&8&&(f.assets=[a[3]]),!s&&c&1&&(s=!0,f.open=a[0],je(()=>s=!1)),i.$set(f)},i(a){l||(m(e.$$.fragment,a),m(i.$$.fragment,a),l=!0)},o(a){v(e.$$.fragment,a),v(i.$$.fragment,a),l=!1},d(a){a&&y(n),A(e,a),A(i,a)}}}function n5(t,e,n){let i,s,l;B(t,me,f=>n(1,i=f)),B(t,mi,f=>n(2,s=f)),B(t,el,f=>n(3,l=f));let r=!1;const o=()=>{Ql(s?`/assets/${s}`:"/assets")},a=()=>{n(0,r=!0)};function c(f){r=f,n(0,r)}return[r,i,s,l,o,a,c,()=>{Ql(s?`/assets/${s}`:"/assets")}]}let i5=class extends ie{constructor(e){super(),ne(this,e,n5,t5,te,{})}};function s5(t){pe(t,"svelte-1yvh9sv",".preview.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%}.preview.tile.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{border-width:1px;border-style:solid;border-color:transparent;padding:var(--tile-padding, 8px);background-color:var(--sui-secondary-background-color)}.preview.icon.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{width:40px;height:40px}.preview.tile.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv,.preview.icon.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{overflow:hidden;border-radius:var(--sui-control-medium-border-radius);aspect-ratio:1/1}.preview.svelte-1yvh9sv .blur.svelte-1yvh9sv.svelte-1yvh9sv{display:contents}.preview.svelte-1yvh9sv .blur.svelte-1yvh9sv>.svelte-1yvh9sv{position:absolute;inset:0;pointer-events:none}.preview.svelte-1yvh9sv .blur.svelte-1yvh9sv .overlay{z-index:-1;backdrop-filter:blur(32px) brightness(0.8)}.preview.svelte-1yvh9sv .blur img.svelte-1yvh9sv.svelte-1yvh9sv,.preview.svelte-1yvh9sv .blur video.svelte-1yvh9sv.svelte-1yvh9sv{width:100%;height:100%;z-index:-2;object-fit:contain;transform:scale(1.2)}.preview.cover.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{padding:0}.preview.svelte-1yvh9sv>video.svelte-1yvh9sv.svelte-1yvh9sv,.preview.svelte-1yvh9sv>img.svelte-1yvh9sv.svelte-1yvh9sv{max-width:100%;max-height:100%}.preview.dissolve.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv,.preview.dissolve.svelte-1yvh9sv video.svelte-1yvh9sv.svelte-1yvh9sv{opacity:0;transition:opacity 250ms}.preview.dissolve.loaded.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv,.preview.dissolve.loaded.svelte-1yvh9sv video.svelte-1yvh9sv.svelte-1yvh9sv{opacity:1}.checkerboard.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv{background-image:linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%), linear-gradient(45deg, #eee 25%, #fff 25%, #fff 75%, #eee 75%);background-size:16px 16px;background-position:0 0, 8px 8px}.svelte-1yvh9sv:not(.checkerboard) img.svelte-1yvh9sv.svelte-1yvh9sv{background-color:#fff}video.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv,img.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv{object-fit:contain}video.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv:not([src]),img.svelte-1yvh9sv.svelte-1yvh9sv.svelte-1yvh9sv:not([src]){visibility:hidden}.cover.svelte-1yvh9sv video.svelte-1yvh9sv.svelte-1yvh9sv,.cover.svelte-1yvh9sv img.svelte-1yvh9sv.svelte-1yvh9sv{object-fit:cover;aspect-ratio:1/1}")}function l5(t){let e,n,i=[{loading:t[2]},{src:n=t[0]},{alt:t[8]},t[11]],s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return{c(){e=D("img"),Ae(e,s),se(e,"svelte-1yvh9sv",!0)},m(l,r){S(l,e,r),t[14](e)},p(l,r){Ae(e,s=Re(i,[r&4&&{loading:l[2]},r&1&&!gi(e.src,n=l[0])&&{src:n},r&256&&{alt:l[8]},r&2048&&l[11]])),se(e,"svelte-1yvh9sv",!0)},d(l){l&&y(e),t[14](null)}}}function r5(t){let e,n,i=[{playsInline:!0},{src:n=t[0]},t[11]],s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return{c(){e=D("video"),Ae(e,s),se(e,"svelte-1yvh9sv",!0)},m(l,r){S(l,e,r),t[13](e)},p(l,r){Ae(e,s=Re(i,[{playsInline:!0},r&1&&!gi(e.src,n=l[0])&&{src:n},r&2048&&l[11]])),se(e,"svelte-1yvh9sv",!0)},d(l){l&&y(e),t[13](null)}}}function Cg(t){let e,n,i;function s(o,a){return o[1]==="video"?a5:o5}let l=s(t),r=l(t);return{c(){e=D("div"),n=D("div"),i=F(),r.c(),E(n,"role","none"),E(n,"class","overlay svelte-1yvh9sv"),E(e,"role","none"),E(e,"class","blur svelte-1yvh9sv")},m(o,a){S(o,e,a),I(e,n),I(e,i),r.m(e,null)},p(o,a){l===(l=s(o))&&r?r.p(o,a):(r.d(1),r=l(o),r&&(r.c(),r.m(e,null)))},d(o){o&&y(e),r.d()}}}function o5(t){let e,n;return{c(){e=D("img"),E(e,"loading",t[2]),gi(e.src,n=t[0])||E(e,"src",n),E(e,"alt",""),E(e,"class","svelte-1yvh9sv")},m(i,s){S(i,e,s)},p(i,s){s&4&&E(e,"loading",i[2]),s&1&&!gi(e.src,n=i[0])&&E(e,"src",n)},d(i){i&&y(e)}}}function a5(t){let e,n;return{c(){e=D("video"),e.playsInline=!0,gi(e.src,n=t[0])||E(e,"src",n),E(e,"class","svelte-1yvh9sv")},m(i,s){S(i,e,s)},p(i,s){s&1&&!gi(e.src,n=i[0])&&E(e,"src",n)},d(i){i&&y(e)}}}function c5(t){let e,n,i;function s(a,c){return a[1]==="video"?r5:l5}let l=s(t),r=l(t),o=t[4]&&Cg(t);return{c(){e=D("div"),r.c(),n=F(),o&&o.c(),E(e,"role","none"),E(e,"class",i="preview "+(t[3]??"")+" svelte-1yvh9sv"),se(e,"cover",t[5]),se(e,"checkerboard",t[6]),se(e,"dissolve",t[7]),se(e,"loaded",t[10])},m(a,c){S(a,e,c),r.m(e,null),I(e,n),o&&o.m(e,null)},p(a,[c]){l===(l=s(a))&&r?r.p(a,c):(r.d(1),r=l(a),r&&(r.c(),r.m(e,n))),a[4]?o?o.p(a,c):(o=Cg(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null),c&8&&i!==(i="preview "+(a[3]??"")+" svelte-1yvh9sv")&&E(e,"class",i),c&40&&se(e,"cover",a[5]),c&72&&se(e,"checkerboard",a[6]),c&136&&se(e,"dissolve",a[7]),c&1032&&se(e,"loaded",a[10])},i:q,o:q,d(a){a&&y(e),r.d(),o&&o.d()}}}function u5(t,e,n){const i=["type","loading","asset","src","variant","blurBackground","cover","checkerboard","dissolve","alt"];let s=re(e,i),{type:l}=e,{loading:r="lazy"}=e,{asset:o=void 0}=e,{src:a=void 0}=e,{variant:c=void 0}=e,{blurBackground:u=!1}=e,{cover:f=!1}=e,{checkerboard:d=!1}=e,{dissolve:h=!0}=e,{alt:_=""}=e,p,b=!1,g=!1;const w=async()=>{o&&p&&!b&&(b=!0,n(0,a=await R$(o,r,p)),b=!1)};ln(()=>{const P=p.matches("video");(P?p.readyState>0:p.complete)?n(10,g=!0):p.addEventListener(P?"loadedmetadata":"load",()=>{n(10,g=!0)},{once:!0})});function k(P){ae[P?"unshift":"push"](()=>{p=P,n(9,p)})}function T(P){ae[P?"unshift":"push"](()=>{p=P,n(9,p)})}return t.$$set=P=>{e=W(W({},e),Ve(P)),n(11,s=re(e,i)),"type"in P&&n(1,l=P.type),"loading"in P&&n(2,r=P.loading),"asset"in P&&n(12,o=P.asset),"src"in P&&n(0,a=P.src),"variant"in P&&n(3,c=P.variant),"blurBackground"in P&&n(4,u=P.blurBackground),"cover"in P&&n(5,f=P.cover),"checkerboard"in P&&n(6,d=P.checkerboard),"dissolve"in P&&n(7,h=P.dissolve),"alt"in P&&n(8,_=P.alt)},t.$$.update=()=>{t.$$.dirty&4608&&w()},[a,l,r,c,u,f,d,h,_,p,g,s,o,k,T]}class Bk extends ie{constructor(e){super(),ne(this,e,u5,c5,te,{type:1,loading:2,asset:12,src:0,variant:3,blurBackground:4,cover:5,checkerboard:6,dissolve:7,alt:8},s5)}}function f5(t){let e,n;const i=[{type:"image"},{loading:t[0]},{asset:t[1]},{src:t[2]},{variant:t[3]},{blurBackground:t[4]},{cover:t[5]},{checkerboard:t[6]},{alt:t[7]},t[8]];let s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return e=new Bk({props:s}),{c(){L(e.$$.fragment)},m(l,r){O(e,l,r),n=!0},p(l,[r]){const o=r&511?Re(i,[i[0],r&1&&{loading:l[0]},r&2&&{asset:l[1]},r&4&&{src:l[2]},r&8&&{variant:l[3]},r&16&&{blurBackground:l[4]},r&32&&{cover:l[5]},r&64&&{checkerboard:l[6]},r&128&&{alt:l[7]},r&256&&Lt(l[8])]):{};e.$set(o)},i(l){n||(m(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){A(e,l)}}}function d5(t,e,n){const i=["loading","asset","src","variant","blurBackground","cover","checkerboard","alt"];let s=re(e,i),{loading:l="lazy"}=e,{asset:r=void 0}=e,{src:o=void 0}=e,{variant:a=void 0}=e,{blurBackground:c=!1}=e,{cover:u=!1}=e,{checkerboard:f=!1}=e,{alt:d=""}=e;return t.$$set=h=>{e=W(W({},e),Ve(h)),n(8,s=re(e,i)),"loading"in h&&n(0,l=h.loading),"asset"in h&&n(1,r=h.asset),"src"in h&&n(2,o=h.src),"variant"in h&&n(3,a=h.variant),"blurBackground"in h&&n(4,c=h.blurBackground),"cover"in h&&n(5,u=h.cover),"checkerboard"in h&&n(6,f=h.checkerboard),"alt"in h&&n(7,d=h.alt)},[l,r,o,a,c,u,f,d,s]}let Si=class extends ie{constructor(e){super(),ne(this,e,d5,f5,te,{loading:0,asset:1,src:2,variant:3,blurBackground:4,cover:5,checkerboard:6,alt:7})}};function h5(t){let e,n;const i=[{type:"video"},{loading:t[0]},{asset:t[1]},{src:t[2]},{variant:t[3]},{blurBackground:t[4]},{cover:t[5]},t[6]];let s={};for(let l=0;l<i.length;l+=1)s=W(s,i[l]);return e=new Bk({props:s}),{c(){L(e.$$.fragment)},m(l,r){O(e,l,r),n=!0},p(l,[r]){const o=r&127?Re(i,[i[0],r&1&&{loading:l[0]},r&2&&{asset:l[1]},r&4&&{src:l[2]},r&8&&{variant:l[3]},r&16&&{blurBackground:l[4]},r&32&&{cover:l[5]},r&64&&Lt(l[6])]):{};e.$set(o)},i(l){n||(m(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){A(e,l)}}}function m5(t,e,n){const i=["loading","asset","src","variant","blurBackground","cover"];let s=re(e,i),{loading:l="lazy"}=e,{asset:r=void 0}=e,{src:o=void 0}=e,{variant:a=void 0}=e,{blurBackground:c=!1}=e,{cover:u=!1}=e;return t.$$set=f=>{e=W(W({},e),Ve(f)),n(6,s=re(e,i)),"loading"in f&&n(0,l=f.loading),"asset"in f&&n(1,r=f.asset),"src"in f&&n(2,o=f.src),"variant"in f&&n(3,a=f.variant),"blurBackground"in f&&n(4,c=f.blurBackground),"cover"in f&&n(5,u=f.cover)},[l,r,o,a,c,u,s]}class Nr extends ie{constructor(e){super(),ne(this,e,m5,h5,te,{loading:0,asset:1,src:2,variant:3,blurBackground:4,cover:5})}}function p5(t){pe(t,"svelte-qwt9km",".detail.svelte-qwt9km.svelte-qwt9km{flex:none;overflow-x:hidden;overflow-y:auto;width:320px;padding:16px}.detail.svelte-qwt9km .preview.svelte-qwt9km{overflow:hidden;margin:0 0 16px;border-radius:var(--sui-control-medium-border-radius);aspect-ratio:1/1}.detail.svelte-qwt9km section.svelte-qwt9km{margin:0 0 16px}.detail.svelte-qwt9km h4.svelte-qwt9km{font-size:var(--sui-font-size-small);font-weight:600;color:var(--sui-secondary-foreground-color)}.detail.svelte-qwt9km h4.svelte-qwt9km,.detail.svelte-qwt9km p.svelte-qwt9km{margin:0 0 4px;word-break:break-all}")}function Dg(t,e,n){const i=t.slice();i[19]=e[n].sha,i[20]=e[n].slug,i[21]=e[n].locales,i[22]=e[n].collectionName,i[23]=e[n].fileName;const s=yi(i[22]);i[24]=s;const l=i[24]._i18n;i[25]=l.defaultLocale!==void 0?l.defaultLocale:"default";const r=i[25]in i[21]?i[25]:Object.keys(i[21])[0];i[26]=r;const o=i[21][i[26]];return i[27]=o.content,i}function Mg(t){let e,n,i,s=t[2]==="image"&&jg(t),l=t[2]==="video"&&Rg(t);return{c(){e=D("div"),s&&s.c(),n=F(),l&&l.c(),E(e,"role","none"),E(e,"class","preview svelte-qwt9km")},m(r,o){S(r,e,o),s&&s.m(e,null),I(e,n),l&&l.m(e,null),i=!0},p(r,o){r[2]==="image"?s?(s.p(r,o),o&4&&m(s,1)):(s=jg(r),s.c(),m(s,1),s.m(e,n)):s&&(H(),v(s,1,1,()=>{s=null}),V()),r[2]==="video"?l?(l.p(r,o),o&4&&m(l,1)):(l=Rg(r),l.c(),m(l,1),l.m(e,null)):l&&(H(),v(l,1,1,()=>{l=null}),V())},i(r){i||(m(s),m(l),i=!0)},o(r){v(s),v(l),i=!1},d(r){r&&y(e),s&&s.d(),l&&l.d()}}}function jg(t){let e,n;return e=new Si({props:{asset:t[0],variant:"tile",checkerboard:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&1&&(l.asset=i[0]),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Rg(t){let e,n;return e=new Nr({props:{asset:t[0],variant:"tile",controls:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&1&&(l.asset=i[0]),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Fg(t){let e,n,i=t[14]("dimensions")+"",s,l,r,o=t[5]?`${t[5].width}×${t[5].height}`:"–",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("dimensions")+"")&&X(s,i),u&32&&o!==(o=c[5]?`${c[5].width}×${c[5].height}`:"–")&&X(a,o)},d(c){c&&y(e)}}}function zg(t){let e,n,i=t[14]("duration")+"",s,l,r,o=(t[6]?Wp(t[6]):"–")+"",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("duration")+"")&&X(s,i),u&64&&o!==(o=(c[6]?Wp(c[6]):"–")+"")&&X(a,o)},d(c){c&&y(e)}}}function g5(t){let e,n;return{c(){e=D("a"),n=K(t[4]),E(e,"href",t[4])},m(i,s){S(i,e,s),I(e,n)},p(i,s){s&16&&X(n,i[4]),s&16&&E(e,"href",i[4])},d(i){i&&y(e)}}}function _5(t){let e;return{c(){e=K("–")},m(n,i){S(n,e,i)},p:q,d(n){n&&y(e)}}}function b5(t){let e,n;return{c(){e=K("/"),n=K(t[3])},m(i,s){S(i,e,s),S(i,n,s)},p(i,s){s&8&&X(n,i[3])},d(i){i&&(y(e),y(n))}}}function v5(t){let e,n,i;return{c(){e=D("a"),n=K("/"),i=K(t[3]),E(e,"href",t[10])},m(s,l){S(s,e,l),I(e,n),I(e,i)},p(s,l){l&8&&X(i,s[3]),l&1024&&E(e,"href",s[10])},d(s){s&&y(e)}}}function Bg(t){let e,n,i=t[14]("sort_keys.commit_author")+"",s,l,r,o=(t[12].name||t[12].login||t[12].email)+"",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("sort_keys.commit_author")+"")&&X(s,i),u&4096&&o!==(o=(c[12].name||c[12].login||c[12].email)+"")&&X(a,o)},d(c){c&&y(e)}}}function Ug(t){let e,n,i=t[14]("sort_keys.commit_date")+"",s,l,r,o=t[11].toLocaleString(t[15])+"",a;return{c(){e=D("section"),n=D("h4"),s=K(i),l=F(),r=D("p"),a=K(o),E(n,"class","svelte-qwt9km"),E(r,"class","svelte-qwt9km"),E(e,"class","svelte-qwt9km")},m(c,u){S(c,e,u),I(e,n),I(n,s),I(e,l),I(e,r),I(r,a)},p(c,u){u&16384&&i!==(i=c[14]("sort_keys.commit_date")+"")&&X(s,i),u&34816&&o!==(o=c[11].toLocaleString(c[15])+"")&&X(a,o)},d(c){c&&y(e)}}}function qg(t){let e,n=t[14]("sort_keys.none")+"",i;return{c(){e=D("p"),i=K(n),E(e,"class","svelte-qwt9km")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&16384&&n!==(n=s[14]("sort_keys.none")+"")&&X(i,n)},d(s){s&&y(e)}}}function w5(t){let e=(t[27][t[24].identifier_field]||t[27].title||t[27].name||t[27].label)+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&128&&e!==(e=(i[27][i[24].identifier_field]||i[27].title||i[27].name||i[27].label)+"")&&X(n,e)},d(i){i&&y(n)}}}function k5(t){let e=t[24].files.find(i).label+"",n;function i(...s){return t[16](t[23],...s)}return{c(){n=K(e)},m(s,l){S(s,n,l)},p(s,l){t=s,l&128&&e!==(e=t[24].files.find(i).label+"")&&X(n,e)},d(s){s&&y(n)}}}function y5(t){let e,n=(t[24].label||t[24].name)+"",i,s;function l(a,c){if(a[24].files)return k5;if(a[27])return w5}let r=l(t),o=r&&r(t);return{c(){e=D("span"),i=K(n),s=K(` »
427
428
  `),o&&o.c(),E(e,"role","none")},m(a,c){S(a,e,c),I(e,i),I(e,s),o&&o.m(e,null)},p(a,c){c&128&&n!==(n=(a[24].label||a[24].name)+"")&&X(i,n),r===(r=l(a))&&o?o.p(a,c):(o&&o.d(1),o=r&&r(a),o&&(o.c(),o.m(e,null)))},d(a){a&&y(e),o&&o.d()}}}function Hg(t,e){let n,i,s,l;function r(){return e[17](e[22],e[23],e[20])}return i=new Ye({props:{role:"link",variant:"link",$$slots:{default:[y5]},$$scope:{ctx:e}}}),i.$on("click",r),{key:t,first:null,c(){n=D("p"),L(i.$$.fragment),s=F(),E(n,"class","svelte-qwt9km"),this.first=n},m(o,a){S(o,n,a),O(i,n,null),I(n,s),l=!0},p(o,a){e=o;const c={};a&1073741952&&(c.$$scope={dirty:a,ctx:e}),i.$set(c)},i(o){l||(m(i.$$.fragment,o),l=!0)},o(o){v(i.$$.fragment,o),l=!1},d(o){o&&y(n),A(i)}}}function S5(t){let e,n,i,s,l=t[14]("kind")+"",r,o,a,c=t[14](`file_type_labels.${t[9]}`,{default:t[9].toUpperCase()})+"",u,f,d,h,_=t[14]("size")+"",p,b,g,w=dr(t[13])+"",k,T,P,N=["audio","video"].includes(t[2]),R,z,$,C=t[14]("public_url")+"",M,j,Q,de,Z,G,Pe,U=t[14]("file_path")+"",J,Ce,we,mt,He,ee,kt,Be,Kt=t[14]("used_in")+"",Xe,bn,Mt=[],ci=new Map,Ft,Et=t[1]&&t[8]&&Mg(t),Yt=t[8]&&Fg(t),Bt=N&&zg(t);function ds(Oe,Ze){return Ze&16&&(de=null),de==null&&(de=!!(!Oe[4]||Oe[4].startsWith("blob:"))),de?_5:g5}let it=ds(t,-1),Le=it(t);function lt(Oe,Ze){return Oe[10]?v5:b5}let tt=lt(t),bt=tt(t),yt=t[12]&&Bg(t),ce=t[11]&&Ug(t),Ke=fe(t[7]);const _t=Oe=>Oe[19];for(let Oe=0;Oe<Ke.length;Oe+=1){let Ze=Dg(t,Ke,Oe),ui=_t(Ze);ci.set(ui,Mt[Oe]=Hg(ui,Ze))}let Nt=null;return Ke.length||(Nt=qg(t)),{c(){e=D("div"),Et&&Et.c(),n=F(),i=D("section"),s=D("h4"),r=K(l),o=F(),a=D("p"),u=K(c),f=F(),d=D("section"),h=D("h4"),p=K(_),b=F(),g=D("p"),k=K(w),T=F(),Yt&&Yt.c(),P=F(),Bt&&Bt.c(),R=F(),z=D("section"),$=D("h4"),M=K(C),j=F(),Q=D("p"),Le.c(),Z=F(),G=D("section"),Pe=D("h4"),J=K(U),Ce=F(),we=D("p"),bt.c(),mt=F(),yt&&yt.c(),He=F(),ce&&ce.c(),ee=F(),kt=D("section"),Be=D("h4"),Xe=K(Kt),bn=F();for(let Oe=0;Oe<Mt.length;Oe+=1)Mt[Oe].c();Nt&&Nt.c(),E(s,"class","svelte-qwt9km"),E(a,"class","svelte-qwt9km"),E(i,"class","svelte-qwt9km"),E(h,"class","svelte-qwt9km"),E(g,"class","svelte-qwt9km"),E(d,"class","svelte-qwt9km"),E($,"class","svelte-qwt9km"),E(Q,"class","svelte-qwt9km"),E(z,"class","svelte-qwt9km"),E(Pe,"class","svelte-qwt9km"),E(we,"class","svelte-qwt9km"),E(G,"class","svelte-qwt9km"),E(Be,"class","svelte-qwt9km"),E(kt,"class","svelte-qwt9km"),E(e,"role","none"),E(e,"class","detail svelte-qwt9km")},m(Oe,Ze){S(Oe,e,Ze),Et&&Et.m(e,null),I(e,n),I(e,i),I(i,s),I(s,r),I(i,o),I(i,a),I(a,u),I(e,f),I(e,d),I(d,h),I(h,p),I(d,b),I(d,g),I(g,k),I(e,T),Yt&&Yt.m(e,null),I(e,P),Bt&&Bt.m(e,null),I(e,R),I(e,z),I(z,$),I($,M),I(z,j),I(z,Q),Le.m(Q,null),I(e,Z),I(e,G),I(G,Pe),I(Pe,J),I(G,Ce),I(G,we),bt.m(we,null),I(e,mt),yt&&yt.m(e,null),I(e,He),ce&&ce.m(e,null),I(e,ee),I(e,kt),I(kt,Be),I(Be,Xe),I(kt,bn);for(let ui=0;ui<Mt.length;ui+=1)Mt[ui]&&Mt[ui].m(kt,null);Nt&&Nt.m(kt,null),Ft=!0},p(Oe,[Ze]){Oe[1]&&Oe[8]?Et?(Et.p(Oe,Ze),Ze&258&&m(Et,1)):(Et=Mg(Oe),Et.c(),m(Et,1),Et.m(e,n)):Et&&(H(),v(Et,1,1,()=>{Et=null}),V()),(!Ft||Ze&16384)&&l!==(l=Oe[14]("kind")+"")&&X(r,l),(!Ft||Ze&16896)&&c!==(c=Oe[14](`file_type_labels.${Oe[9]}`,{default:Oe[9].toUpperCase()})+"")&&X(u,c),(!Ft||Ze&16384)&&_!==(_=Oe[14]("size")+"")&&X(p,_),(!Ft||Ze&8192)&&w!==(w=dr(Oe[13])+"")&&X(k,w),Oe[8]?Yt?Yt.p(Oe,Ze):(Yt=Fg(Oe),Yt.c(),Yt.m(e,P)):Yt&&(Yt.d(1),Yt=null),Ze&4&&(N=["audio","video"].includes(Oe[2])),N?Bt?Bt.p(Oe,Ze):(Bt=zg(Oe),Bt.c(),Bt.m(e,R)):Bt&&(Bt.d(1),Bt=null),(!Ft||Ze&16384)&&C!==(C=Oe[14]("public_url")+"")&&X(M,C),it===(it=ds(Oe,Ze))&&Le?Le.p(Oe,Ze):(Le.d(1),Le=it(Oe),Le&&(Le.c(),Le.m(Q,null))),(!Ft||Ze&16384)&&U!==(U=Oe[14]("file_path")+"")&&X(J,U),tt===(tt=lt(Oe))&&bt?bt.p(Oe,Ze):(bt.d(1),bt=tt(Oe),bt&&(bt.c(),bt.m(we,null))),Oe[12]?yt?yt.p(Oe,Ze):(yt=Bg(Oe),yt.c(),yt.m(e,He)):yt&&(yt.d(1),yt=null),Oe[11]?ce?ce.p(Oe,Ze):(ce=Ug(Oe),ce.c(),ce.m(e,ee)):ce&&(ce.d(1),ce=null),(!Ft||Ze&16384)&&Kt!==(Kt=Oe[14]("used_in")+"")&&X(Xe,Kt),Ze&16512&&(Ke=fe(Oe[7]),H(),Mt=ut(Mt,Ze,_t,1,Oe,Ke,ci,kt,ct,Hg,null,Dg),V(),!Ke.length&&Nt?Nt.p(Oe,Ze):Ke.length?Nt&&(Nt.d(1),Nt=null):(Nt=qg(Oe),Nt.c(),Nt.m(kt,null)))},i(Oe){if(!Ft){m(Et);for(let Ze=0;Ze<Ke.length;Ze+=1)m(Mt[Ze]);Ft=!0}},o(Oe){v(Et);for(let Ze=0;Ze<Mt.length;Ze+=1)v(Mt[Ze]);Ft=!1},d(Oe){Oe&&y(e),Et&&Et.d(),Yt&&Yt.d(),Bt&&Bt.d(),Le.d(),bt.d(),yt&&yt.d(),ce&&ce.d();for(let Ze=0;Ze<Mt.length;Ze+=1)Mt[Ze].d();Nt&&Nt.d()}}}function T5(t,e,n){let i,s,l,r,o,a,c,u,f,d;B(t,me,N=>n(14,f=N)),B(t,xt,N=>n(15,d=N));let{asset:h}=e,{showPreview:_=!1}=e,p,b,g,w=[];const k=async()=>{n(4,{displayURL:p,dimensions:b,duration:g,usedEntries:w}=await oO(h),p,n(5,b),n(6,g),n(7,w))},T=(N,{name:R})=>R===N,P=(N,R,z)=>{mn(`/collections/${N}/entries/${R||z}`)};return t.$$set=N=>{"asset"in N&&n(0,h=N.asset),"showPreview"in N&&n(1,_=N.showPreview)},t.$$.update=()=>{t.$$.dirty&1&&n(3,{path:i,size:s,kind:l,commitAuthor:r,commitDate:o,repoFileURL:a}=h,i,(n(13,s),n(0,h)),(n(2,l),n(0,h)),(n(12,r),n(0,h)),(n(11,o),n(0,h)),(n(10,a),n(0,h))),t.$$.dirty&8&&n(9,[,c=""]=i.match(/\.([^.]+)$/)??[],c),t.$$.dirty&4&&n(8,u=["image","video"].includes(l)),t.$$.dirty&1&&k()},[h,_,l,i,p,b,g,w,u,c,a,o,r,s,f,d,T,P]}class Uk extends ie{constructor(e){super(),ne(this,e,T5,S5,te,{asset:0,showPreview:1},p5)}}function E5(t){pe(t,"svelte-17yv21",".empty.svelte-17yv21{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;width:100%;height:100%;text-align:center}")}function O5(t){let e,n;const i=t[1].default,s=ke(i,t,t[0],null);return{c(){e=D("div"),s&&s.c(),E(e,"role","none"),E(e,"class","empty svelte-17yv21")},m(l,r){S(l,e,r),s&&s.m(e,null),n=!0},p(l,[r]){s&&s.p&&(!n||r&1)&&Se(s,i,l,l[0],n?ye(i,l[0],r,null):Te(l[0]),null)},i(l){n||(m(s,l),n=!0)},o(l){v(s,l),n=!1},d(l){l&&y(e),s&&s.d(l)}}}function A5(t,e,n){let{$$slots:i={},$$scope:s}=e;return t.$$set=l=>{"$$scope"in l&&n(0,s=l.$$scope)},[s,i]}class An extends ie{constructor(e){super(),ne(this,e,A5,O5,te,{},E5)}}function L5(t){pe(t,"svelte-8zguev",".wrapper.svelte-8zguev.svelte-8zguev{position:fixed;inset:0;display:flex;flex-direction:column;background-color:var(--sui-primary-background-color)}.wrapper.svelte-8zguev .row.svelte-8zguev{flex:auto;display:flex;overflow:hidden}.wrapper.svelte-8zguev .row .preview.svelte-8zguev{flex:auto;overflow:hidden;border-right:1px solid var(--sui-primary-border-color)}")}function $5(t){let e,n;return e=new An({props:{$$slots:{default:[I5]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&20&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function N5(t){let e,n;return e=new Nr({props:{asset:t[1],blurBackground:!0,controls:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&2&&(l.asset=i[1]),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function P5(t){let e,n;return e=new Si({props:{asset:t[1],blurBackground:!0,checkerboard:!0,alt:t[1].name}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&2&&(l.asset=i[1]),s&2&&(l.alt=i[1].name),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function I5(t){let e,n=t[2]("no_preview_available")+"",i;return{c(){e=D("span"),i=K(n),E(e,"role","alert")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&4&&n!==(n=s[2]("no_preview_available")+"")&&X(i,n)},d(s){s&&y(e)}}}function C5(t){let e,n,i,s,l,r,o,a,c,u;n=new i5({});const f=[P5,N5,$5],d=[];function h(_,p){return _[1].kind==="image"?0:_[1].kind==="video"?1:2}return r=h(t),o=d[r]=f[r](t),c=new Uk({props:{asset:t[1]}}),{c(){e=D("div"),L(n.$$.fragment),i=F(),s=D("div"),l=D("div"),o.c(),a=F(),L(c.$$.fragment),E(l,"role","none"),E(l,"class","preview svelte-8zguev"),E(s,"role","none"),E(s,"class","row svelte-8zguev"),E(e,"role","none"),E(e,"class","wrapper svelte-8zguev")},m(_,p){S(_,e,p),O(n,e,null),I(e,i),I(e,s),I(s,l),d[r].m(l,null),I(s,a),O(c,s,null),t[3](e),u=!0},p(_,p){let b=r;r=h(_),r===b?d[r].p(_,p):(H(),v(d[b],1,1,()=>{d[b]=null}),V(),o=d[r],o?o.p(_,p):(o=d[r]=f[r](_),o.c()),m(o,1),o.m(l,null));const g={};p&2&&(g.asset=_[1]),c.$set(g)},i(_){u||(m(n.$$.fragment,_),m(o),m(c.$$.fragment,_),u=!0)},o(_){v(n.$$.fragment,_),v(o),v(c.$$.fragment,_),u=!1},d(_){_&&y(e),A(n),d[r].d(),A(c),t[3](null)}}}function D5(t){let e,n;return e=new rn({props:{"aria-label":t[2]("asset_editor"),$$slots:{default:[C5]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&4&&(l["aria-label"]=i[2]("asset_editor")),s&23&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function M5(t,e,n){let i,s;B(t,el,o=>n(1,i=o)),B(t,me,o=>n(2,s=o));let l;ln(()=>{const o=l.closest('[role="group"]');return o.tabIndex=0,o.focus(),()=>{$e(el,i=null,i)}});function r(o){ae[o?"unshift":"push"](()=>{l=o,n(0,l)})}return[l,i,s,r]}class j5 extends ie{constructor(e){super(),ne(this,e,M5,D5,te,{},L5)}}function R5(t){let e,n;return e=new lv({props:{role:"none",tabindex:"-1",checked:t[7].includes(t[0])}}),e.$on("change",t[9]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&129&&(l.checked=i[7].includes(i[0])),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Vg(t){let e,n;return e=new Si({props:{asset:t[0],variant:t[1]==="list"?"icon":"tile",checkerboard:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&1&&(l.asset=i[0]),s&2&&(l.variant=i[1]==="list"?"icon":"tile"),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Yg(t){let e,n;return e=new Nr({props:{asset:t[0],variant:t[1]==="list"?"icon":"tile"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&1&&(l.asset=i[0]),s&2&&(l.variant=i[1]==="list"?"icon":"tile"),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function F5(t){let e,n,i,s=t[2]==="image"&&Vg(t),l=t[2]==="video"&&Yg(t);return{c(){s&&s.c(),e=F(),l&&l.c(),n=x()},m(r,o){s&&s.m(r,o),S(r,e,o),l&&l.m(r,o),S(r,n,o),i=!0},p(r,o){r[2]==="image"?s?(s.p(r,o),o&4&&m(s,1)):(s=Vg(r),s.c(),m(s,1),s.m(e.parentNode,e)):s&&(H(),v(s,1,1,()=>{s=null}),V()),r[2]==="video"?l?(l.p(r,o),o&4&&m(l,1)):(l=Yg(r),l.c(),m(l,1),l.m(n.parentNode,n)):l&&(H(),v(l,1,1,()=>{l=null}),V())},i(r){i||(m(s),m(l),i=!0)},o(r){v(s),v(l),i=!1},d(r){r&&(y(e),y(n)),s&&s.d(r),l&&l.d(r)}}}function z5(t){let e,n;return{c(){e=D("span"),n=K(t[3]),E(e,"role","none")},m(i,s){S(i,e,s),I(e,n)},p(i,s){s&8&&X(n,i[3])},d(i){i&&y(e)}}}function B5(t){let e,n,i,s,l,r;return e=new qn({props:{class:"checkbox",$$slots:{default:[R5]},$$scope:{ctx:t}}}),i=new qn({props:{class:"image",$$slots:{default:[F5]},$$scope:{ctx:t}}}),l=new qn({props:{class:"title",$$slots:{default:[z5]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment),n=F(),L(i.$$.fragment),s=F(),L(l.$$.fragment)},m(o,a){O(e,o,a),S(o,n,a),O(i,o,a),S(o,s,a),O(l,o,a),r=!0},p(o,a){const c={};a&4225&&(c.$$scope={dirty:a,ctx:o}),e.$set(c);const u={};a&4103&&(u.$$scope={dirty:a,ctx:o}),i.$set(u);const f={};a&4104&&(f.$$scope={dirty:a,ctx:o}),l.$set(f)},i(o){r||(m(e.$$.fragment,o),m(i.$$.fragment,o),m(l.$$.fragment,o),r=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(l.$$.fragment,o),r=!1},d(o){o&&(y(n),y(s)),A(e,o),A(i,o),A(l,o)}}}function U5(t){let e,n;return e=new Ao({props:{"aria-rowindex":t[4].indexOf(t[0]),$$slots:{default:[B5]},$$scope:{ctx:t}}}),e.$on("change",t[10]),e.$on("click",t[11]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&17&&(l["aria-rowindex"]=i[4].indexOf(i[0])),s&4239&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function q5(t,e,n){let i,s,l,r,o,a;B(t,gl,p=>n(4,l=p)),B(t,Rf,p=>n(5,r=p)),B(t,Vn,p=>n(6,o=p)),B(t,xs,p=>n(7,a=p));let{asset:c}=e,{viewType:u}=e;const f=p=>{xs.update(b=>{const g=b.indexOf(c);return p&&g===-1&&b.push(c),!p&&g>-1&&b.splice(g,1),b})},d=({detail:{checked:p}})=>{f(p)},h=({detail:{selected:p}})=>{f(p)},_=()=>{$e(Rf,r=c,r),o?.showInfo||Vn.update(p=>({...p,showInfo:!o?.showInfo}))};return t.$$set=p=>{"asset"in p&&n(0,c=p.asset),"viewType"in p&&n(1,u=p.viewType)},t.$$.update=()=>{t.$$.dirty&1&&n(3,{name:i,kind:s}=c,i,(n(2,s),n(0,c)))},[c,u,s,i,l,r,o,a,f,d,h,_]}class H5 extends ie{constructor(e){super(),ne(this,e,q5,U5,te,{asset:0,viewType:1})}}function V5(t){let e,n,i;return{c(){e=D("input"),E(e,"type","file"),e.hidden=!0,E(e,"accept",t[0]),e.multiple=t[1]},m(s,l){S(s,e,l),t[5](e),n||(i=We(e,"change",t[4]),n=!0)},p(s,[l]){l&1&&E(e,"accept",s[0]),l&2&&(e.multiple=s[1])},i:q,o:q,d(s){s&&y(e),t[5](null),n=!1,i()}}}function Y5(t,e,n){let i,{accept:s=void 0}=e,{multiple:l=!1}=e;const r=()=>{i?.click()};function o(c){oe.call(this,t,c)}function a(c){ae[c?"unshift":"push"](()=>{i=c,n(2,i)})}return t.$$set=c=>{"accept"in c&&n(0,s=c.accept),"multiple"in c&&n(1,l=c.multiple)},[s,l,i,r,o,a]}class Oh extends ie{constructor(e){super(),ne(this,e,Y5,V5,te,{accept:0,multiple:1,open:3})}get open(){return this.$$.ctx[3]}}function G5(t){pe(t,"svelte-zswg2f",".files.svelte-zswg2f.svelte-zswg2f{display:flex;flex-direction:column;gap:16px;padding:16px 0 0}.file.svelte-zswg2f.svelte-zswg2f{display:flex;align-items:center;gap:16px}.file.svelte-zswg2f .image.svelte-zswg2f{display:flex;justify-content:center;align-items:center;width:40px;height:40px;aspect-ratio:1/1;object-fit:cover;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-tertiary-background-color)}.file.svelte-zswg2f .meta.svelte-zswg2f{flex:auto;display:flex;flex-direction:column;gap:4px}.file.svelte-zswg2f .meta .size.svelte-zswg2f{font-size:var(--sui-font-size-small);color:var(--sui-secondary-foreground-color)}")}function Gg(t,e,n){const i=t.slice();i[3]=e[n],i[9]=n;const s=i[3];i[4]=s.name,i[5]=s.type,i[6]=s.size;const l=i[4].match(/\.([^.]+)$/)??[];return i[7]=l[1]!==void 0?l[1]:"",i}function W5(t){let e,n,i;return n=new Ne({props:{name:"draft"}}),{c(){e=D("span"),L(n.$$.fragment),E(e,"role","none"),E(e,"class","image svelte-zswg2f")},m(s,l){S(s,e,l),O(n,e,null),i=!0},p:q,i(s){i||(m(n.$$.fragment,s),i=!0)},o(s){v(n.$$.fragment,s),i=!1},d(s){s&&y(e),A(n)}}}function K5(t){let e,n;return e=new Si({props:{src:URL.createObjectURL(t[3]),variant:"icon",checkerboard:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&1&&(l.src=URL.createObjectURL(i[3])),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Z5(t){let e,n;return e=new Ne({props:{name:"close"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Wg(t){let e,n,i,s,l,r,o,a=t[4]+"",c,u,f,d=dr(t[6])+"",h,_,p=t[1](`file_type_labels.${t[7]}`,{default:t[7].toUpperCase()})+"",b,g,w,k,T;const P=[K5,W5],N=[];function R($,C){return C&1&&(n=null),n==null&&(n=!!$[5].startsWith("image/")),n?0:1}i=R(t,-1),s=N[i]=P[i](t);function z(...$){return t[2](t[9],...$)}return w=new Ye({props:{variant:"ghost",iconic:!0,"aria-label":t[1]("remove"),$$slots:{default:[Z5]},$$scope:{ctx:t}}}),w.$on("click",z),{c(){e=D("div"),s.c(),l=F(),r=D("div"),o=D("div"),c=K(a),u=F(),f=D("div"),h=K(d),_=K(`
428
429
  ·
429
430
  `),b=K(p),g=F(),L(w.$$.fragment),k=F(),E(o,"role","none"),E(o,"class","name"),E(f,"role","none"),E(f,"class","size svelte-zswg2f"),E(r,"role","none"),E(r,"class","meta svelte-zswg2f"),E(e,"role","none"),E(e,"class","file svelte-zswg2f")},m($,C){S($,e,C),N[i].m(e,null),I(e,l),I(e,r),I(r,o),I(o,c),I(r,u),I(r,f),I(f,h),I(f,_),I(f,b),I(e,g),O(w,e,null),I(e,k),T=!0},p($,C){t=$;let M=i;i=R(t,C),i===M?N[i].p(t,C):(H(),v(N[M],1,1,()=>{N[M]=null}),V(),s=N[i],s?s.p(t,C):(s=N[i]=P[i](t),s.c()),m(s,1),s.m(e,l)),(!T||C&1)&&a!==(a=t[4]+"")&&X(c,a),(!T||C&1)&&d!==(d=dr(t[6])+"")&&X(h,d),(!T||C&3)&&p!==(p=t[1](`file_type_labels.${t[7]}`,{default:t[7].toUpperCase()})+"")&&X(b,p);const j={};C&2&&(j["aria-label"]=t[1]("remove")),C&1024&&(j.$$scope={dirty:C,ctx:t}),w.$set(j)},i($){T||(m(s),m(w.$$.fragment,$),T=!0)},o($){v(s),v(w.$$.fragment,$),T=!1},d($){$&&y(e),N[i].d(),A(w)}}}function X5(t){let e,n,i=fe(t[0]),s=[];for(let r=0;r<i.length;r+=1)s[r]=Wg(Gg(t,i,r));const l=r=>v(s[r],1,1,()=>{s[r]=null});return{c(){e=D("div");for(let r=0;r<s.length;r+=1)s[r].c();E(e,"role","none"),E(e,"class","files svelte-zswg2f")},m(r,o){S(r,e,o);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null);n=!0},p(r,[o]){if(o&3){i=fe(r[0]);let a;for(a=0;a<i.length;a+=1){const c=Gg(r,i,a);s[a]?(s[a].p(c,o),m(s[a],1)):(s[a]=Wg(c),s[a].c(),m(s[a],1),s[a].m(e,null))}for(H(),a=i.length;a<s.length;a+=1)l(a);V()}},i(r){if(!n){for(let o=0;o<i.length;o+=1)m(s[o]);n=!0}},o(r){s=s.filter(Boolean);for(let o=0;o<s.length;o+=1)v(s[o]);n=!1},d(r){r&&y(e),si(s,r)}}}function J5(t,e,n){let i;B(t,me,r=>n(1,i=r));let{files:s=[]}=e;const l=(r,o)=>{o.stopPropagation(),s.splice(r,1),n(0,s)};return t.$$set=r=>{"files"in r&&n(0,s=r.files)},[s,i,l]}class Ah extends ie{constructor(e){super(),ne(this,e,J5,X5,te,{files:0},G5)}}function Q5(t){pe(t,"svelte-1x6hy7d",".drop-target.svelte-1x6hy7d.svelte-1x6hy7d{display:flex;flex-direction:column;position:relative;overflow:hidden;height:100%;pointer-events:auto}.drop-target.svelte-1x6hy7d>.group{overflow-y:auto;padding:16px;width:100%;height:100%}.drop-target.svelte-1x6hy7d .svelte-1x6hy7d{pointer-events:none}.drop-indicator.svelte-1x6hy7d.svelte-1x6hy7d{position:absolute;inset:0;z-index:10;background-color:hsl(var(--sui-background-color-4-hsl)/80%);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);pointer-events:none}.drop-indicator.svelte-1x6hy7d div.svelte-1x6hy7d{position:absolute;inset:32px;display:flex;justify-content:center;align-items:center;font-size:var(--sui-font-size-xxx-large);border-width:8px;border-style:dashed;border-color:var(--sui-primary-accent-color-inverted);border-radius:8px}.content.svelte-1x6hy7d.svelte-1x6hy7d{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;overflow:auto;height:100%;min-height:320px}")}function x5(t){let e,n,i,s=t[2]&&Kg(t),l=t[3]&&t[5].length&&Zg(t);return{c(){e=D("div"),s&&s.c(),n=F(),l&&l.c(),E(e,"role","none"),E(e,"class","content svelte-1x6hy7d")},m(r,o){S(r,e,o),s&&s.m(e,null),I(e,n),l&&l.m(e,null),i=!0},p(r,o){r[2]?s?(s.p(r,o),o&4&&m(s,1)):(s=Kg(r),s.c(),m(s,1),s.m(e,n)):s&&(H(),v(s,1,1,()=>{s=null}),V()),r[3]&&r[5].length?l?(l.p(r,o),o&40&&m(l,1)):(l=Zg(r),l.c(),m(l,1),l.m(e,null)):l&&(H(),v(l,1,1,()=>{l=null}),V())},i(r){i||(m(s),m(l),i=!0)},o(r){v(s),v(l),i=!1},d(r){r&&y(e),s&&s.d(),l&&l.d()}}}function eN(t){let e;const n=t[11].default,i=ke(n,t,t[21],null);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&2097152)&&Se(i,n,s,s[21],e?ye(n,s[21],l,null):Te(s[21]),null)},i(s){e||(m(i,s),e=!0)},o(s){v(i,s),e=!1},d(s){i&&i.d(s)}}}function tN(t){let e,n,i,s;function l(o){t[12](o)}let r={};return t[5]!==void 0&&(r.files=t[5]),n=new Ah({props:r}),ae.push(()=>De(n,"files",l)),{c(){e=D("div"),L(n.$$.fragment),E(e,"role","none"),E(e,"class","content svelte-1x6hy7d")},m(o,a){S(o,e,a),O(n,e,null),s=!0},p(o,a){const c={};!i&&a&32&&(i=!0,c.files=o[5],je(()=>i=!1)),n.$set(c)},i(o){s||(m(n.$$.fragment,o),s=!0)},o(o){v(n.$$.fragment,o),s=!1},d(o){o&&y(e),A(n)}}}function Kg(t){let e,n=t[8]("drop_files_or_browse")+"",i,s,l,r,o;return r=new Ye({props:{variant:"primary",label:t[8]("upload"),$$slots:{"start-icon":[nN]},$$scope:{ctx:t}}}),r.$on("click",t[13]),{c(){e=D("div"),i=K(n),s=F(),l=D("div"),L(r.$$.fragment),E(e,"role","none"),E(e,"class","svelte-1x6hy7d"),E(l,"role","none"),E(l,"class","svelte-1x6hy7d")},m(a,c){S(a,e,c),I(e,i),S(a,s,c),S(a,l,c),O(r,l,null),o=!0},p(a,c){(!o||c&256)&&n!==(n=a[8]("drop_files_or_browse")+"")&&X(i,n);const u={};c&256&&(u.label=a[8]("upload")),c&2097152&&(u.$$scope={dirty:c,ctx:a}),r.$set(u)},i(a){o||(m(r.$$.fragment,a),o=!0)},o(a){v(r.$$.fragment,a),o=!1},d(a){a&&(y(e),y(s),y(l)),A(r)}}}function nN(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"cloud_upload"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function Zg(t){let e,n,i;function s(r){t[14](r)}let l={};return t[5]!==void 0&&(l.files=t[5]),e=new Ah({props:l}),ae.push(()=>De(e,"files",s)),{c(){L(e.$$.fragment)},m(r,o){O(e,r,o),i=!0},p(r,o){const a={};!n&&o&32&&(n=!0,a.files=r[5],je(()=>n=!1)),e.$set(a)},i(r){i||(m(e.$$.fragment,r),i=!0)},o(r){v(e.$$.fragment,r),i=!1},d(r){A(e,r)}}}function Xg(t){let e,n,i=t[8]("drop_files_here")+"",s;return{c(){e=D("div"),n=D("div"),s=K(i),E(n,"role","none"),E(n,"class","svelte-1x6hy7d"),E(e,"role","none"),E(e,"class","drop-indicator svelte-1x6hy7d")},m(l,r){S(l,e,r),I(e,n),I(n,s)},p(l,r){r&256&&i!==(i=l[8]("drop_files_here")+"")&&X(s,i)},d(l){l&&y(e)}}}function iN(t){let e,n,i,s,l,r,o,a,c;const u=[tN,eN,x5],f=[];function d(p,b){return!p[2]&&p[3]&&p[5].length?0:p[10].default?1:2}n=d(t),i=f[n]=u[n](t);let h=t[6]&&Xg(t),_={accept:t[0],multiple:t[1]};return r=new Oh({props:_}),t[19](r),r.$on("change",t[20]),{c(){e=D("div"),i.c(),s=F(),h&&h.c(),l=F(),L(r.$$.fragment),E(e,"class","drop-target svelte-1x6hy7d"),E(e,"role","none")},m(p,b){S(p,e,b),f[n].m(e,null),I(e,s),h&&h.m(e,null),S(p,l,b),O(r,p,b),o=!0,a||(c=[We(e,"dragover",_s(t[15])),We(e,"dragleave",_s(t[16])),We(e,"dragend",_s(t[17])),We(e,"drop",_s(t[18]))],a=!0)},p(p,[b]){let g=n;n=d(p),n===g?f[n].p(p,b):(H(),v(f[g],1,1,()=>{f[g]=null}),V(),i=f[n],i?i.p(p,b):(i=f[n]=u[n](p),i.c()),m(i,1),i.m(e,s)),p[6]?h?h.p(p,b):(h=Xg(p),h.c(),h.m(e,null)):h&&(h.d(1),h=null);const w={};b&1&&(w.accept=p[0]),b&2&&(w.multiple=p[1]),r.$set(w)},i(p){o||(m(i),m(r.$$.fragment,p),o=!0)},o(p){v(i),v(r.$$.fragment,p),o=!1},d(p){p&&(y(e),y(l)),f[n].d(),h&&h.d(),t[19](null),A(r,p),a=!1,Wt(c)}}}function sN(t,e,n){let i;B(t,me,C=>n(8,i=C));let{$$slots:s={},$$scope:l}=e;const r=cl(s);let{accept:o=void 0}=e,{multiple:a=!1}=e,{showUploadButton:c=!1}=e,{showFilePreview:u=!1}=e;const f=Ms();let d=!1,h,_=[];const p=()=>{h.open()},b=C=>{n(5,_=a?C:C.slice(0,1))};function g(C){_=C,n(5,_)}const w=()=>{p()};function k(C){_=C,n(5,_)}const T=({dataTransfer:C})=>{C.dropEffect="copy",n(6,d=!0)},P=()=>{n(6,d=!1)},N=()=>{n(6,d=!1)},R=async({dataTransfer:C})=>{n(6,d=!1),b(await x8(C,{accept:o}))};function z(C){ae[C?"unshift":"push"](()=>{h=C,n(7,h)})}const $=({target:C})=>{b([...C.files])};return t.$$set=C=>{"accept"in C&&n(0,o=C.accept),"multiple"in C&&n(1,a=C.multiple),"showUploadButton"in C&&n(2,c=C.showUploadButton),"showFilePreview"in C&&n(3,u=C.showFilePreview),"$$scope"in C&&n(21,l=C.$$scope)},t.$$.update=()=>{t.$$.dirty&32&&f("select",{files:_})},[o,a,c,u,p,_,d,h,i,b,r,s,g,w,k,T,P,N,R,z,$,l]}class Jc extends ie{constructor(e){super(),ne(this,e,sN,iN,te,{accept:0,multiple:1,showUploadButton:2,showFilePreview:3,openFilePicker:4},Q5)}get openFilePicker(){return this.$$.ctx[4]}}function lN(t){pe(t,"svelte-1ipy119",".list-container.svelte-1ipy119{flex:auto;position:relative;height:100%;overflow:hidden}.list-container.svelte-1ipy119>.group{padding:16px;height:100%;overflow-y:auto;overscroll-behavior-y:contain}.list-container.svelte-1ipy119>.group .drop-target{height:auto}")}function rN(t){let e;const n=t[1].default,i=ke(n,t,t[2],null);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4)&&Se(i,n,s,s[2],e?ye(n,s[2],l,null):Te(s[2]),null)},i(s){e||(m(i,s),e=!0)},o(s){v(i,s),e=!1},d(s){i&&i.d(s)}}}function oN(t){let e,n,i;const s=[t[0]];let l={$$slots:{default:[rN]},$$scope:{ctx:t}};for(let r=0;r<s.length;r+=1)l=W(l,s[r]);return n=new rn({props:l}),{c(){e=D("div"),L(n.$$.fragment),E(e,"role","none"),E(e,"class","list-container svelte-1ipy119")},m(r,o){S(r,e,o),O(n,e,null),i=!0},p(r,[o]){const a=o&1?Re(s,[Lt(r[0])]):{};o&4&&(a.$$scope={dirty:o,ctx:r}),n.$set(a)},i(r){i||(m(n.$$.fragment,r),i=!0)},o(r){v(n.$$.fragment,r),i=!1},d(r){r&&y(e),A(n)}}}function aN(t,e,n){const i=[];let s=re(e,i),{$$slots:l={},$$scope:r}=e;return t.$$set=o=>{e=W(W({},e),Ve(o)),n(0,s=re(e,i)),"$$scope"in o&&n(2,r=o.$$scope)},[s,l,r]}class Lh extends ie{constructor(e){super(),ne(this,e,aN,oN,te,{},lN)}}function cN(t){pe(t,"svelte-15zfho2",'.grid-view.svelte-15zfho2{display:contents}.grid-view.svelte-15zfho2 .row-group-caption{display:block;grid-column:1/-1}.grid-view.svelte-15zfho2 .row-group-caption th{display:block}.grid-view.svelte-15zfho2 .row-group:not(:first-child){margin:16px 0 0}.grid-view.svelte-15zfho2 .grid-body{display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--grid-size, 200px), 1fr));gap:16px;border-width:0}.grid-view.svelte-15zfho2 [role="row"]{display:block;position:relative;overflow:hidden;padding:0;height:auto;text-align:left;cursor:pointer}.grid-view.svelte-15zfho2 [role="row"]:focus-visible{outline-color:transparent}.grid-view.svelte-15zfho2 [role="row"]:focus-visible .preview{outline-offset:-2px;outline-width:2px;outline-style:solid;outline-color:var(--sui-primary-accent-color-light)}.grid-view.svelte-15zfho2 [role="row"] .grid-cell{display:block}.grid-view.svelte-15zfho2 [role="row"] .checkbox{position:absolute;inset:8px auto auto 8px;z-index:2}.grid-view.svelte-15zfho2 [role="row"] .title span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:12px 8px 0;height:40px;line-height:1.5}.list-view.svelte-15zfho2{display:contents}.list-view.svelte-15zfho2 [role="grid"] .row-group .row-group-caption ~ .grid-row:first-of-type .grid-cell{border-top-width:0 !important}.list-view.svelte-15zfho2 [role="grid"] .row-group .row-group-caption ~ .grid-row:last-of-type .grid-cell{border-bottom-width:0 !important}.list-view.svelte-15zfho2 [role="grid"] [role="row"]{cursor:pointer;transition:all 200ms}.list-view.svelte-15zfho2 [role="grid"] [role="row"]:hover{background-color:var(--sui-hover-background-color)}.list-view.svelte-15zfho2 [role="grid"] [role="gridcell"]{vertical-align:middle;overflow:hidden;text-overflow:ellipsis;height:40px;padding:0 8px;max-width:100%;color:var(--sui-secondary-foreground-color);white-space:nowrap}.list-view.svelte-15zfho2 [role="grid"] [role="gridcell"] .label{overflow:hidden;text-overflow:ellipsis}.list-view.svelte-15zfho2 [role="grid"] [role="gridcell"]:first-child{padding-left:16px}.list-view.svelte-15zfho2 [role="grid"] [role="gridcell"]:last-child{padding-right:16px}.list-view.svelte-15zfho2 [role="grid"] [role="row"] [role="gridcell"]{border-width:1px 0 0;border-color:var(--sui-secondary-border-color)}.list-view.svelte-15zfho2 [role="grid"] [role="row"]:last-child [role="gridcell"]{border-width:1px 0}.list-view.svelte-15zfho2 [role="grid"] [role="gridcell"].checkbox{width:16px}.list-view.svelte-15zfho2 [role="grid"] [role="gridcell"].title{width:100%;color:var(--sui-primary-foreground-color)}.list-view.svelte-15zfho2 [role="grid"] [role="gridcell"].image{padding:8px}')}function uN(t){let e;const n=t[2].default,i=ke(n,t,t[3],null);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&8)&&Se(i,n,s,s[3],e?ye(n,s[3],l,null):Te(s[3]),null)},i(s){e||(m(i,s),e=!0)},o(s){v(i,s),e=!1},d(s){i&&i.d(s)}}}function fN(t){let e,n,i,s;const l=[{multiple:!0},t[1]];let r={$$slots:{default:[uN]},$$scope:{ctx:t}};for(let o=0;o<l.length;o+=1)r=W(r,l[o]);return n=new mT({props:r}),{c(){e=D("div"),L(n.$$.fragment),E(e,"role","none"),E(e,"class",i=t[0]+"-view svelte-15zfho2")},m(o,a){S(o,e,a),O(n,e,null),s=!0},p(o,[a]){const c=a&2?Re(l,[l[0],Lt(o[1])]):{};a&8&&(c.$$scope={dirty:a,ctx:o}),n.$set(c),(!s||a&1&&i!==(i=o[0]+"-view svelte-15zfho2"))&&E(e,"class",i)},i(o){s||(m(n.$$.fragment,o),s=!0)},o(o){v(n.$$.fragment,o),s=!1},d(o){o&&y(e),A(n)}}}function dN(t,e,n){const i=["viewType"];let s=re(e,i),{$$slots:l={},$$scope:r}=e,{viewType:o}=e;return t.$$set=a=>{e=W(W({},e),Ve(a)),n(1,s=re(e,i)),"viewType"in a&&n(0,o=a.viewType),"$$scope"in a&&n(3,r=a.$$scope)},[o,s,l,r]}class Fo extends ie{constructor(e){super(),ne(this,e,dN,fN,te,{viewType:0},cN)}}function Jg(t,e,n){const i=t.slice();return i[8]=e[n][0],i[9]=e[n][1],i}function Qg(t,e,n){const i=t.slice();return i[12]=e[n],i}function hN(t){let e,n;return e=new An({props:{$$slots:{default:[pN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&32769&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function mN(t){let e,n;return e=new Jc({props:{multiple:!0,$$slots:{default:[bN]},$$scope:{ctx:t}}}),e.$on("select",t[7]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&32867&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function pN(t){let e,n=t[0]("no_files_found")+"",i;return{c(){e=D("span"),i=K(n),E(e,"role","none")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&1&&n!==(n=s[0]("no_files_found")+"")&&X(i,n)},d(s){s&&y(e)}}}function xg(t,e){let n,i,s;return i=new H5({props:{asset:e[12],viewType:e[5].type}}),{key:t,first:null,c(){n=x(),L(i.$$.fragment),this.first=n},m(l,r){S(l,n,r),O(i,l,r),s=!0},p(l,r){e=l;const o={};r&2&&(o.asset=e[12]),r&32&&(o.viewType=e[5].type),i.$set(o)},i(l){s||(m(i.$$.fragment,l),s=!0)},o(l){v(i.$$.fragment,l),s=!1},d(l){l&&y(n),A(i,l)}}}function gN(t){let e=[],n=new Map,i,s,l=fe(t[9]);const r=o=>o[12].path;for(let o=0;o<l.length;o+=1){let a=Qg(t,l,o),c=r(a);n.set(c,e[o]=xg(c,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=F()},m(o,a){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(o,a);S(o,i,a),s=!0},p(o,a){a&34&&(l=fe(o[9]),H(),e=ut(e,a,r,1,o,l,n,i.parentNode,ct,xg,i,Qg),V())},i(o){if(!s){for(let a=0;a<l.length;a+=1)m(e[a]);s=!0}},o(o){for(let a=0;a<e.length;a+=1)v(e[a]);s=!1},d(o){o&&y(i);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function e_(t,e){let n,i,s;return i=new ov({props:{label:e[8]!=="*"?e[8]:void 0,$$slots:{default:[gN]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=x(),L(i.$$.fragment),this.first=n},m(l,r){S(l,n,r),O(i,l,r),s=!0},p(l,r){e=l;const o={};r&2&&(o.label=e[8]!=="*"?e[8]:void 0),r&32802&&(o.$$scope={dirty:r,ctx:e}),i.$set(o)},i(l){s||(m(i.$$.fragment,l),s=!0)},o(l){v(i.$$.fragment,l),s=!1},d(l){l&&y(n),A(i,l)}}}function _N(t){let e=[],n=new Map,i,s,l=fe(Object.entries(t[1]));const r=o=>o[8];for(let o=0;o<l.length;o+=1){let a=Jg(t,l,o),c=r(a);n.set(c,e[o]=e_(c,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=x()},m(o,a){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(o,a);S(o,i,a),s=!0},p(o,a){a&34&&(l=fe(Object.entries(o[1])),H(),e=ut(e,a,r,1,o,l,n,i.parentNode,ct,e_,i,Jg),V())},i(o){if(!s){for(let a=0;a<l.length;a+=1)m(e[a]);s=!0}},o(o){for(let a=0;a<e.length;a+=1)v(e[a]);s=!1},d(o){o&&y(i);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function bN(t){let e,n;return e=new Fo({props:{id:"asset-list",viewType:t[5].type,"aria-label":t[0]("assets"),"aria-rowcount":t[6].length,$$slots:{default:[_N]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&32&&(l.viewType=i[5].type),s&1&&(l["aria-label"]=i[0]("assets")),s&64&&(l["aria-rowcount"]=i[6].length),s&32802&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function vN(t){let e,n,i,s,l;const r=[mN,hN],o=[];function a(c,u){return u&2&&(e=null),e==null&&(e=!!Object.values(c[1]).flat(1).length),e?0:1}return n=a(t,-1),i=o[n]=r[n](t),{c(){i.c(),s=x()},m(c,u){o[n].m(c,u),S(c,s,u),l=!0},p(c,u){let f=n;n=a(c,u),n===f?o[n].p(c,u):(H(),v(o[f],1,1,()=>{o[f]=null}),V(),i=o[n],i?i.p(c,u):(i=o[n]=r[n](c),i.c()),m(i,1),i.m(s.parentNode,s))},i(c){l||(m(i),l=!0)},o(c){v(i),l=!1},d(c){c&&y(s),o[n].d(c)}}}function wN(t){let e,n;return e=new Lh({props:{"aria-label":t[0]("asset_list"),$$slots:{default:[vN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&1&&(l["aria-label"]=i[0]("asset_list")),s&32895&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function kN(t,e,n){let i,s,l,r,o,a,c;return B(t,me,f=>n(0,i=f)),B(t,Fk,f=>n(1,s=f)),B(t,Bn,f=>n(2,l=f)),B(t,mi,f=>n(3,r=f)),B(t,Ot,f=>n(4,o=f)),B(t,Vn,f=>n(5,a=f)),B(t,gl,f=>n(6,c=f)),[i,s,l,r,o,a,c,({detail:{files:f}})=>{$e(Bn,l={folder:r||o.media_folder,files:f},l)}]}class yN extends ie{constructor(e){super(),ne(this,e,kN,wN,te,{})}}function t_(t,e,n){const i=t.slice();i[7]=e[n].collectionName,i[8]=e[n].internalPath;const s=i[8]===i[2];return i[9]=s,i}function SN(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"folder"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function n_(t,e){let n,i,s;function l(){return e[5](e[8])}function r(...o){return e[6](e[8],e[9],...o)}return i=new li({props:{selected:e[9],label:e[3]?to(e[7]):"",$$slots:{"start-icon":[SN]},$$scope:{ctx:e}}}),i.$on("select",l),i.$on("dragover",r),i.$on("dragleave",ON),i.$on("dragend",AN),i.$on("drop",LN),{key:t,first:null,c(){n=x(),L(i.$$.fragment),this.first=n},m(o,a){S(o,n,a),O(i,o,a),s=!0},p(o,a){e=o;const c={};a&5&&(c.selected=e[9]),a&9&&(c.label=e[3]?to(e[7]):""),a&4096&&(c.$$scope={dirty:a,ctx:e}),i.$set(c)},i(o){s||(m(i.$$.fragment,o),s=!0)},o(o){v(i.$$.fragment,o),s=!1},d(o){o&&y(n),A(i,o)}}}function TN(t){let e=[],n=new Map,i,s,l=fe(t[0]);const r=o=>o[7];for(let o=0;o<l.length;o+=1){let a=t_(t,l,o),c=r(a);n.set(c,e[o]=n_(c,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=x()},m(o,a){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(o,a);S(o,i,a),s=!0},p(o,a){a&13&&(l=fe(o[0]),H(),e=ut(e,a,r,1,o,l,n,i.parentNode,ct,n_,i,t_),V())},i(o){if(!s){for(let a=0;a<l.length;a+=1)m(e[a]);s=!0}},o(o){for(let a=0;a<e.length;a+=1)v(e[a]);s=!1},d(o){o&&y(i);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function EN(t){let e,n,i;return n=new Lo({props:{"aria-label":t[1]("asset_folders"),"aria-controls":"assets-container",$$slots:{default:[TN]},$$scope:{ctx:t}}}),{c(){e=D("div"),L(n.$$.fragment),E(e,"role","none"),E(e,"class","primary-sidebar")},m(s,l){S(s,e,l),O(n,e,null),i=!0},p(s,[l]){const r={};l&2&&(r["aria-label"]=s[1]("asset_folders")),l&4109&&(r.$$scope={dirty:l,ctx:s}),n.$set(r)},i(s){i||(m(n.$$.fragment,s),i=!0)},o(s){v(n.$$.fragment,s),i=!1},d(s){s&&y(e),A(n)}}}const ON=t=>{t.preventDefault(),t.target.classList.remove("dragover")},AN=t=>{t.preventDefault(),t.target.classList.remove("dragover")},LN=t=>{t.preventDefault(),t.target.classList.remove("dragover")};function $N(t,e,n){let i,s,l,r,o;B(t,_i,u=>n(4,s=u)),B(t,me,u=>n(1,l=u)),B(t,mi,u=>n(2,r=u)),B(t,xt,u=>n(3,o=u));const a=u=>{mn(u?`/assets/${u}`:"/assets")},c=(u,f,d)=>{d.preventDefault(),!u||f?d.dataTransfer.dropEffect="none":(d.dataTransfer.dropEffect="move",d.target.classList.add("dragover"))};return t.$$.update=()=>{t.$$.dirty&16&&n(0,i=[{collectionName:"*",internalPath:""},...s])},[i,l,r,o,s,a,c]}let NN=class extends ie{constructor(e){super(),ne(this,e,$N,EN,te,{})}};function i_(t){let e,n,i;return{c(){e=D("span"),n=K("/"),i=K(t[0]),E(e,"role","none")},m(s,l){S(s,e,l),I(e,n),I(e,i)},p(s,l){l&1&&X(i,s[0])},d(s){s&&y(e)}}}function PN(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"delete"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function IN(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"cloud_upload"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function CN(t){let e,n,i,s,l,r,o,a,c,u,f=t[0]&&i_(t);return l=new En({props:{flex:!0}}),o=new Ye({props:{variant:"secondary",disabled:!t[5].length,label:t[4]("delete"),"aria-label":t[5].length===1?t[4]("delete_selected_asset"):t[4]("delete_selected_assets"),$$slots:{"start-icon":[PN]},$$scope:{ctx:t}}}),o.$on("click",t[9]),c=new Ye({props:{variant:"primary",label:t[4]("upload"),"aria-label":t[4]("upload_files"),$$slots:{"start-icon":[IN]},$$scope:{ctx:t}}}),c.$on("click",t[10]),{c(){e=D("h2"),n=K(t[3]),i=F(),f&&f.c(),s=F(),L(l.$$.fragment),r=F(),L(o.$$.fragment),a=F(),L(c.$$.fragment),E(e,"role","none")},m(d,h){S(d,e,h),I(e,n),I(e,i),f&&f.m(e,null),S(d,s,h),O(l,d,h),S(d,r,h),O(o,d,h),S(d,a,h),O(c,d,h),u=!0},p(d,h){(!u||h&8)&&X(n,d[3]),d[0]?f?f.p(d,h):(f=i_(d),f.c(),f.m(e,null)):f&&(f.d(1),f=null);const _={};h&32&&(_.disabled=!d[5].length),h&16&&(_.label=d[4]("delete")),h&48&&(_["aria-label"]=d[5].length===1?d[4]("delete_selected_asset"):d[4]("delete_selected_assets")),h&16384&&(_.$$scope={dirty:h,ctx:d}),o.$set(_);const p={};h&16&&(p.label=d[4]("upload")),h&16&&(p["aria-label"]=d[4]("upload_files")),h&16384&&(p.$$scope={dirty:h,ctx:d}),c.$set(p)},i(d){u||(m(l.$$.fragment,d),m(o.$$.fragment,d),m(c.$$.fragment,d),u=!0)},o(d){v(l.$$.fragment,d),v(o.$$.fragment,d),v(c.$$.fragment,d),u=!1},d(d){d&&(y(e),y(s),y(r),y(a)),f&&f.d(),A(l,d),A(o,d),A(c,d)}}}function DN(t){let e,n,i,s,l,r,o;e=new Rs({props:{variant:"primary","aria-label":t[4]("folder"),$$slots:{default:[CN]},$$scope:{ctx:t}}});let a={multiple:!0};i=new Oh({props:a}),t[11](i),i.$on("change",t[12]);function c(f){t[13](f)}let u={assets:t[5]};return t[2]!==void 0&&(u.open=t[2]),l=new zk({props:u}),ae.push(()=>De(l,"open",c)),{c(){L(e.$$.fragment),n=F(),L(i.$$.fragment),s=F(),L(l.$$.fragment)},m(f,d){O(e,f,d),S(f,n,d),O(i,f,d),S(f,s,d),O(l,f,d),o=!0},p(f,[d]){const h={};d&16&&(h["aria-label"]=f[4]("folder")),d&16447&&(h.$$scope={dirty:d,ctx:f}),e.$set(h);const _={};i.$set(_);const p={};d&32&&(p.assets=f[5]),!r&&d&4&&(r=!0,p.open=f[2],je(()=>r=!1)),l.$set(p)},i(f){o||(m(e.$$.fragment,f),m(i.$$.fragment,f),m(l.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(l.$$.fragment,f),o=!1},d(f){f&&(y(n),y(s)),A(e,f),t[11](null),A(i,f),A(l,f)}}}function MN(t,e,n){let i,s,l,r,o,a,c;B(t,mi,g=>n(0,s=g)),B(t,xt,g=>n(8,l=g)),B(t,me,g=>n(4,r=g)),B(t,xs,g=>n(5,o=g)),B(t,Bn,g=>n(6,a=g)),B(t,Ot,g=>n(7,c=g));let u,f=!1;const d=()=>{n(2,f=!0)},h=()=>{u.open()};function _(g){ae[g?"unshift":"push"](()=>{u=g,n(1,u)})}const p=({target:g})=>{$e(Bn,a={folder:s||c.media_folder,files:[...g.files]},a)};function b(g){f=g,n(2,f)}return t.$$.update=()=>{t.$$.dirty&257&&n(3,i=l?_r(s):"")},[s,u,f,i,r,o,a,c,l,d,h,_,p,b]}let jN=class extends ie{constructor(e){super(),ne(this,e,MN,DN,te,{})}};function RN(t){let e,n;return e=new An({props:{$$slots:{default:[zN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&10&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function FN(t){let e,n;return e=new Uk({props:{asset:t[2],showPreview:!0}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&4&&(l.asset=i[2]),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function zN(t){let e,n=t[1]("select_asset_show_info")+"",i;return{c(){e=D("span"),i=K(n),E(e,"role","none")},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&2&&n!==(n=s[1]("select_asset_show_info")+"")&&X(i,n)},d(s){s&&y(e)}}}function BN(t){let e,n,i,s;const l=[FN,RN],r=[];function o(a,c){return a[2]?0:1}return e=o(t),n=r[e]=l[e](t),{c(){n.c(),i=x()},m(a,c){r[e].m(a,c),S(a,i,c),s=!0},p(a,c){let u=e;e=o(a),e===u?r[e].p(a,c):(H(),v(r[u],1,1,()=>{r[u]=null}),V(),n=r[e],n?n.p(a,c):(n=r[e]=l[e](a),n.c()),m(n,1),n.m(i.parentNode,i))},i(a){s||(m(n),s=!0)},o(a){v(n),s=!1},d(a){a&&y(i),r[e].d(a)}}}function UN(t){let e,n;return e=new rn({props:{id:"asset-info",class:"secondary-sidebar",hidden:!t[0]?.showInfo,"aria-label":t[1]("asset_info"),$$slots:{default:[BN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&1&&(l.hidden=!i[0]?.showInfo),s&2&&(l["aria-label"]=i[1]("asset_info")),s&14&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function qN(t,e,n){let i,s,l;return B(t,Vn,r=>n(0,i=r)),B(t,me,r=>n(1,s=r)),B(t,Rf,r=>n(2,l=r)),[i,s,l]}let HN=class extends ie{constructor(e){super(),ne(this,e,qN,UN,te,{})}};function s_(t,e,n){const i=t.slice();return i[14]=e[n].label,i[15]=e[n].field,i[16]=e[n].pattern,i}function l_(t,e,n){const i=t.slice();i[14]=e[n].label,i[15]=e[n].field,i[16]=e[n].pattern;const s=(i[8].filters||[]).findIndex(function(...r){return t[10](i[15],i[16],...r)});return i[17]=s,i}function VN(t){let e,n;return e=new Ne({props:{slot:"end-icon",name:"arrow_drop_down"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function YN(t){let e,n,i,s;e=new $o({props:{label:t[3]||t[7]("sort_keys.none"),checked:!t[8].filter,"aria-controls":t[6]}}),e.$on("select",t[11]);let l=fe(t[5]),r=[];for(let a=0;a<l.length;a+=1)r[a]=r_(s_(t,l,a));const o=a=>v(r[a],1,1,()=>{r[a]=null});return{c(){L(e.$$.fragment),n=F();for(let a=0;a<r.length;a+=1)r[a].c();i=x()},m(a,c){O(e,a,c),S(a,n,c);for(let u=0;u<r.length;u+=1)r[u]&&r[u].m(a,c);S(a,i,c),s=!0},p(a,c){const u={};if(c&136&&(u.label=a[3]||a[7]("sort_keys.none")),c&256&&(u.checked=!a[8].filter),c&64&&(u["aria-controls"]=a[6]),e.$set(u),c&368){l=fe(a[5]);let f;for(f=0;f<l.length;f+=1){const d=s_(a,l,f);r[f]?(r[f].p(d,c),m(r[f],1)):(r[f]=r_(d),r[f].c(),m(r[f],1),r[f].m(i.parentNode,i))}for(H(),f=l.length;f<r.length;f+=1)o(f);V()}},i(a){if(!s){m(e.$$.fragment,a);for(let c=0;c<l.length;c+=1)m(r[c]);s=!0}},o(a){v(e.$$.fragment,a),r=r.filter(Boolean);for(let c=0;c<r.length;c+=1)v(r[c]);s=!1},d(a){a&&(y(n),y(i)),A(e,a),si(r,a)}}}function GN(t){let e,n,i=fe(t[5]),s=[];for(let r=0;r<i.length;r+=1)s[r]=o_(l_(t,i,r));const l=r=>v(s[r],1,1,()=>{s[r]=null});return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=x()},m(r,o){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(r,o);S(r,e,o),n=!0},p(r,o){if(o&304){i=fe(r[5]);let a;for(a=0;a<i.length;a+=1){const c=l_(r,i,a);s[a]?(s[a].p(c,o),m(s[a],1)):(s[a]=o_(c),s[a].c(),m(s[a],1),s[a].m(e.parentNode,e))}for(H(),a=i.length;a<s.length;a+=1)l(a);V()}},i(r){if(!n){for(let o=0;o<i.length;o+=1)m(s[o]);n=!0}},o(r){s=s.filter(Boolean);for(let o=0;o<s.length;o+=1)v(s[o]);n=!1},d(r){r&&y(e),si(s,r)}}}function r_(t){let e,n;function i(){return t[12](t[15],t[16])}return e=new $o({props:{label:t[14],checked:t[8].filter?.field===t[15]&&t[8].filter?.pattern===t[16],"aria-controls":t[6]}}),e.$on("select",i),{c(){L(e.$$.fragment)},m(s,l){O(e,s,l),n=!0},p(s,l){t=s;const r={};l&32&&(r.label=t[14]),l&288&&(r.checked=t[8].filter?.field===t[15]&&t[8].filter?.pattern===t[16]),l&64&&(r["aria-controls"]=t[6]),e.$set(r)},i(s){n||(m(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){A(e,s)}}}function o_(t){let e,n;function i(){return t[9](t[17],t[15],t[16])}return e=new Ef({props:{label:t[14],checked:t[17]>-1}}),e.$on("change",i),{c(){L(e.$$.fragment)},m(s,l){O(e,s,l),n=!0},p(s,l){t=s;const r={};l&32&&(r.label=t[14]),l&288&&(r.checked=t[17]>-1),e.$set(r)},i(s){n||(m(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){A(e,s)}}}function WN(t){let e,n,i,s;const l=[GN,YN],r=[];function o(a,c){return a[2]?0:1}return e=o(t),n=r[e]=l[e](t),{c(){n.c(),i=x()},m(a,c){r[e].m(a,c),S(a,i,c),s=!0},p(a,c){let u=e;e=o(a),e===u?r[e].p(a,c):(H(),v(r[u],1,1,()=>{r[u]=null}),V(),n=r[e],n?n.p(a,c):(n=r[e]=l[e](a),n.c()),m(n,1),n.m(i.parentNode,i))},i(a){s||(m(n),s=!0)},o(a){v(n),s=!1},d(a){a&&y(i),r[e].d(a)}}}function KN(t){let e,n;return e=new Bi({props:{slot:"popup","aria-label":t[7]("filtering_options"),$$slots:{default:[WN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&128&&(l["aria-label"]=i[7]("filtering_options")),s&4194812&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function ZN(t){let e,n;return e=new cs({props:{variant:"ghost",label:t[0]||t[7]("filter"),disabled:t[1],$$slots:{popup:[KN],"end-icon":[VN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&129&&(l.label=i[0]||i[7]("filter")),s&2&&(l.disabled=i[1]),s&4194812&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function XN(t,e,n){let i;const s=["label","disabled","multiple","noneLabel","currentView","filters"];let l=re(e,s),r,o,a=q,c=()=>(a(),a=Mn(_,T=>n(8,o=T)),_);B(t,me,T=>n(7,r=T)),t.$$.on_destroy.push(()=>a());let{label:u=""}=e,{disabled:f=!1}=e,{multiple:d=!1}=e,{noneLabel:h=""}=e,{currentView:_=Ge({})}=e;c();let{filters:p=[]}=e;const b=(T,P,N)=>{_.update(R=>{const z=R.filters?[...R.filters]:[];return T>-1?z.splice(T,1):z.push({field:P,pattern:N}),{...R,filters:z}})},g=(T,P,N)=>N.field===T&&N.pattern===P,w=()=>{_.update(T=>({...T,filter:void 0}))},k=(T,P)=>{_.update(N=>({...N,filter:{field:T,pattern:P}}))};return t.$$set=T=>{e=W(W({},e),Ve(T)),n(13,l=re(e,s)),"label"in T&&n(0,u=T.label),"disabled"in T&&n(1,f=T.disabled),"multiple"in T&&n(2,d=T.multiple),"noneLabel"in T&&n(3,h=T.noneLabel),"currentView"in T&&c(n(4,_=T.currentView)),"filters"in T&&n(5,p=T.filters)},t.$$.update=()=>{n(6,i=l["aria-controls"])},[u,f,d,h,_,p,i,r,o,b,g,w,k]}class qk extends ie{constructor(e){super(),ne(this,e,XN,ZN,te,{label:0,disabled:1,multiple:2,noneLabel:3,currentView:4,filters:5})}}function a_(t,e,n){const i=t.slice();return i[11]=e[n].key,i[12]=e[n].label,i}function c_(t,e,n){const i=t.slice();return i[15]=e[n],i}function JN(t){let e,n;return e=new Ne({props:{slot:"end-icon",name:"arrow_drop_down"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function u_(t,e){let n,i,s;function l(){return e[9](e[11],e[15])}return i=new $o({props:{label:e[5](e[8].includes(e[11])?`${e[15]}_date`:e[15],{values:{label:e[12]}}),checked:e[6].sort?.key===e[11]&&e[6].sort?.order===e[15],"aria-controls":e[4]}}),i.$on("select",l),{key:t,first:null,c(){n=x(),L(i.$$.fragment),this.first=n},m(r,o){S(r,n,o),O(i,r,o),s=!0},p(r,o){e=r;const a={};o&40&&(a.label=e[5](e[8].includes(e[11])?`${e[15]}_date`:e[15],{values:{label:e[12]}})),o&72&&(a.checked=e[6].sort?.key===e[11]&&e[6].sort?.order===e[15]),o&16&&(a["aria-controls"]=e[4]),i.$set(a)},i(r){s||(m(i.$$.fragment,r),s=!0)},o(r){v(i.$$.fragment,r),s=!1},d(r){r&&y(n),A(i,r)}}}function f_(t,e){let n,i=[],s=new Map,l,r,o=fe(e[7]);const a=c=>c[15];for(let c=0;c<o.length;c+=1){let u=c_(e,o,c),f=a(u);s.set(f,i[c]=u_(f,u))}return{key:t,first:null,c(){n=x();for(let c=0;c<i.length;c+=1)i[c].c();l=x(),this.first=n},m(c,u){S(c,n,u);for(let f=0;f<i.length;f+=1)i[f]&&i[f].m(c,u);S(c,l,u),r=!0},p(c,u){e=c,u&508&&(o=fe(e[7]),H(),i=ut(i,u,a,1,e,o,s,l.parentNode,ct,u_,l,c_),V())},i(c){if(!r){for(let u=0;u<o.length;u+=1)m(i[u]);r=!0}},o(c){for(let u=0;u<i.length;u+=1)v(i[u]);r=!1},d(c){c&&(y(n),y(l));for(let u=0;u<i.length;u+=1)i[u].d(c)}}}function QN(t){let e=[],n=new Map,i,s,l=fe(t[3]);const r=o=>o[11];for(let o=0;o<l.length;o+=1){let a=a_(t,l,o),c=r(a);n.set(c,e[o]=f_(c,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=x()},m(o,a){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(o,a);S(o,i,a),s=!0},p(o,a){a&508&&(l=fe(o[3]),H(),e=ut(e,a,r,1,o,l,n,i.parentNode,ct,f_,i,a_),V())},i(o){if(!s){for(let a=0;a<l.length;a+=1)m(e[a]);s=!0}},o(o){for(let a=0;a<e.length;a+=1)v(e[a]);s=!1},d(o){o&&y(i);for(let a=0;a<e.length;a+=1)e[a].d(o)}}}function xN(t){let e,n;return e=new Bi({props:{slot:"popup","aria-label":t[5]("sorting_options"),$$slots:{default:[QN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&32&&(l["aria-label"]=i[5]("sorting_options")),s&262268&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function eP(t){let e,n;return e=new cs({props:{variant:"ghost",label:t[0]||t[5]("sort"),disabled:t[1],$$slots:{popup:[xN],"end-icon":[JN]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&33&&(l.label=i[0]||i[5]("sort")),s&2&&(l.disabled=i[1]),s&262268&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function tP(t,e,n){let i;const s=["label","disabled","currentView","fields"];let l=re(e,s),r,o,a=q,c=()=>(a(),a=Mn(d,g=>n(6,o=g)),d);B(t,me,g=>n(5,r=g)),t.$$.on_destroy.push(()=>a());let{label:u=""}=e,{disabled:f=!1}=e,{currentView:d=Ge({})}=e;c();let{fields:h=[]}=e;const _=["ascending","descending"],p=["date","commit_date"],b=(g,w)=>{d.update(k=>({...k,sort:{key:g,order:w}}))};return t.$$set=g=>{e=W(W({},e),Ve(g)),n(10,l=re(e,s)),"label"in g&&n(0,u=g.label),"disabled"in g&&n(1,f=g.disabled),"currentView"in g&&c(n(2,d=g.currentView)),"fields"in g&&n(3,h=g.fields)},t.$$.update=()=>{n(4,i=l["aria-controls"])},[u,f,d,h,i,r,o,_,p,b]}class Hk extends ie{constructor(e){super(),ne(this,e,tP,eP,te,{label:0,disabled:1,currentView:2,fields:3})}}function nP(t){pe(t,"svelte-1adg8sx",".wrapper.svelte-1adg8sx{display:contents}.wrapper.svelte-1adg8sx button{border-radius:var(--sui-button-medium-border-radius) !important}")}function iP(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"format_list_bulleted"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function sP(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"grid_view"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function lP(t){let e,n,i,s;return e=new rr({props:{disabled:t[0],selected:t[3].type!=="grid",variant:"ghost",iconic:!0,"aria-label":t[2]("list_view"),$$slots:{"start-icon":[iP]},$$scope:{ctx:t}}}),e.$on("select",t[5]),i=new rr({props:{disabled:t[0],selected:t[3].type==="grid",variant:"ghost",iconic:!0,"aria-label":t[2]("grid_view"),$$slots:{"start-icon":[sP]},$$scope:{ctx:t}}}),i.$on("select",t[6]),{c(){L(e.$$.fragment),n=F(),L(i.$$.fragment)},m(l,r){O(e,l,r),S(l,n,r),O(i,l,r),s=!0},p(l,r){const o={};r&1&&(o.disabled=l[0]),r&8&&(o.selected=l[3].type!=="grid"),r&4&&(o["aria-label"]=l[2]("list_view")),r&128&&(o.$$scope={dirty:r,ctx:l}),e.$set(o);const a={};r&1&&(a.disabled=l[0]),r&8&&(a.selected=l[3].type==="grid"),r&4&&(a["aria-label"]=l[2]("grid_view")),r&128&&(a.$$scope={dirty:r,ctx:l}),i.$set(a)},i(l){s||(m(e.$$.fragment,l),m(i.$$.fragment,l),s=!0)},o(l){v(e.$$.fragment,l),v(i.$$.fragment,l),s=!1},d(l){l&&y(n),A(e,l),A(i,l)}}}function rP(t){let e,n,i;const s=[{disabled:t[0]},{"aria-label":t[2]("switch_view")},t[4]];let l={$$slots:{default:[lP]},$$scope:{ctx:t}};for(let r=0;r<s.length;r+=1)l=W(l,s[r]);return n=new yc({props:l}),{c(){e=D("div"),L(n.$$.fragment),E(e,"role","none"),E(e,"class","wrapper svelte-1adg8sx")},m(r,o){S(r,e,o),O(n,e,null),i=!0},p(r,[o]){const a=o&21?Re(s,[o&1&&{disabled:r[0]},o&4&&{"aria-label":r[2]("switch_view")},o&16&&Lt(r[4])]):{};o&143&&(a.$$scope={dirty:o,ctx:r}),n.$set(a)},i(r){i||(m(n.$$.fragment,r),i=!0)},o(r){v(n.$$.fragment,r),i=!1},d(r){r&&y(e),A(n)}}}function oP(t,e,n){const i=["disabled","currentView"];let s=re(e,i),l,r,o=q,a=()=>(o(),o=Mn(u,h=>n(3,r=h)),u);B(t,me,h=>n(2,l=h)),t.$$.on_destroy.push(()=>o());let{disabled:c=!1}=e,{currentView:u=Ge({})}=e;a();const f=()=>{u.update(h=>({...h,type:"list"}))},d=()=>{u.update(h=>({...h,type:"grid"}))};return t.$$set=h=>{e=W(W({},e),Ve(h)),n(4,s=re(e,i)),"disabled"in h&&n(0,c=h.disabled),"currentView"in h&&a(n(1,u=h.currentView))},[c,u,l,r,s,f,d]}class $h extends ie{constructor(e){super(),ne(this,e,oP,rP,te,{disabled:0,currentView:1},nP)}}function d_(t){let e,n;return e=new Rs({props:{variant:"secondary","aria-label":t[3]("asset_list"),$$slots:{default:[cP]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&8&&(l["aria-label"]=i[3]("asset_list")),s&8443&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function aP(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"info"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function cP(t){let e,n,i,s,l,r,o,a,c,u,f,d,h,_,p,b;return e=new Ye({props:{variant:"ghost",disabled:t[4].length===Object.values(t[5]).flat(1).length,label:t[3]("select_all"),"aria-controls":"asset-list"}}),e.$on("click",t[9]),i=new Ye({props:{variant:"ghost",disabled:!t[4].length,label:t[3]("clear_selection"),"aria-controls":"asset-list"}}),i.$on("click",t[10]),l=new En({props:{flex:!0}}),o=new Hk({props:{disabled:!t[0],currentView:Vn,fields:t[6],"aria-controls":"asset-list"}}),c=new qk({props:{label:t[3]("file_type"),disabled:!t[0],currentView:Vn,noneLabel:t[3]("all"),filters:Kp.map(t[11]),"aria-controls":"asset-list"}}),f=new $h({props:{disabled:!t[1],currentView:Vn,"aria-controls":"asset-list"}}),h=new Sn({}),p=new Ye({props:{variant:"ghost",iconic:!0,disabled:!t[1],pressed:!!t[7]?.showInfo,"aria-controls":"asset-info","aria-expanded":!!t[7]?.showInfo,"aria-label":t[3](t[7]?.showInfo?"hide_info":"show_info"),$$slots:{"start-icon":[aP]},$$scope:{ctx:t}}}),p.$on("click",t[12]),{c(){L(e.$$.fragment),n=F(),L(i.$$.fragment),s=F(),L(l.$$.fragment),r=F(),L(o.$$.fragment),a=F(),L(c.$$.fragment),u=F(),L(f.$$.fragment),d=F(),L(h.$$.fragment),_=F(),L(p.$$.fragment)},m(g,w){O(e,g,w),S(g,n,w),O(i,g,w),S(g,s,w),O(l,g,w),S(g,r,w),O(o,g,w),S(g,a,w),O(c,g,w),S(g,u,w),O(f,g,w),S(g,d,w),O(h,g,w),S(g,_,w),O(p,g,w),b=!0},p(g,w){const k={};w&48&&(k.disabled=g[4].length===Object.values(g[5]).flat(1).length),w&8&&(k.label=g[3]("select_all")),e.$set(k);const T={};w&16&&(T.disabled=!g[4].length),w&8&&(T.label=g[3]("clear_selection")),i.$set(T);const P={};w&1&&(P.disabled=!g[0]),w&64&&(P.fields=g[6]),o.$set(P);const N={};w&8&&(N.label=g[3]("file_type")),w&1&&(N.disabled=!g[0]),w&8&&(N.noneLabel=g[3]("all")),w&8&&(N.filters=Kp.map(g[11])),c.$set(N);const R={};w&2&&(R.disabled=!g[1]),f.$set(R);const z={};w&2&&(z.disabled=!g[1]),w&128&&(z.pressed=!!g[7]?.showInfo),w&128&&(z["aria-expanded"]=!!g[7]?.showInfo),w&136&&(z["aria-label"]=g[3](g[7]?.showInfo?"hide_info":"show_info")),w&8192&&(z.$$scope={dirty:w,ctx:g}),p.$set(z)},i(g){b||(m(e.$$.fragment,g),m(i.$$.fragment,g),m(l.$$.fragment,g),m(o.$$.fragment,g),m(c.$$.fragment,g),m(f.$$.fragment,g),m(h.$$.fragment,g),m(p.$$.fragment,g),b=!0)},o(g){v(e.$$.fragment,g),v(i.$$.fragment,g),v(l.$$.fragment,g),v(o.$$.fragment,g),v(c.$$.fragment,g),v(f.$$.fragment,g),v(h.$$.fragment,g),v(p.$$.fragment,g),b=!1},d(g){g&&(y(n),y(s),y(r),y(a),y(u),y(d),y(_)),A(e,g),A(i,g),A(l,g),A(o,g),A(c,g),A(f,g),A(h,g),A(p,g)}}}function uP(t){let e,n,i=!t[2].files&&d_(t);return{c(){i&&i.c(),e=x()},m(s,l){i&&i.m(s,l),S(s,e,l),n=!0},p(s,[l]){s[2].files?i&&(H(),v(i,1,1,()=>{i=null}),V()):i?(i.p(s,l),l&4&&m(i,1)):(i=d_(s),i.c(),m(i,1),i.m(e.parentNode,e))},i(s){n||(m(i),n=!0)},o(s){v(i),n=!1},d(s){s&&y(e),i&&i.d(s)}}}function fP(t,e,n){let i,s,l,r,o,a,c,u,f;B(t,gl,b=>n(8,l=b)),B(t,Rt,b=>n(2,r=b)),B(t,me,b=>n(3,o=b)),B(t,xs,b=>n(4,a=b)),B(t,Fk,b=>n(5,c=b)),B(t,q$,b=>n(6,u=b)),B(t,Vn,b=>n(7,f=b));const d=()=>{$e(xs,a=Object.values(c).flat(1),a)},h=()=>{$e(xs,a=[],a)},_=b=>({label:o(b),field:"fileType",pattern:b}),p=()=>{Vn.update(b=>({...b,showInfo:!f?.showInfo}))};return t.$$.update=()=>{t.$$.dirty&256&&n(1,i=!!l.length),t.$$.dirty&256&&n(0,s=l.length>1)},[s,i,r,o,a,c,u,f,l,d,h,_,p]}let dP=class extends ie{constructor(e){super(),ne(this,e,fP,uP,te,{})}};function hP(t){pe(t,"svelte-1msxade",".main-inner.svelte-1msxade.svelte-1msxade{flex:auto;display:flex;overflow:hidden}.main-inner.svelte-1msxade .main-inner-main.svelte-1msxade{flex:auto;display:flex;flex-direction:column;overflow:hidden}.main-inner.svelte-1msxade .secondary-sidebar{flex:none;overflow:auto;width:320px;border-left:1px solid var(--sui-primary-border-color)}")}const mP=t=>({}),h_=t=>({}),pP=t=>({}),m_=t=>({}),gP=t=>({}),p_=t=>({}),_P=t=>({}),g_=t=>({});function bP(t){let e,n,i,s,l,r;const o=t[1].primary_toolbar,a=ke(o,t,t[0],g_),c=t[1].secondary_toolbar,u=ke(c,t,t[0],p_),f=t[1].main_content,d=ke(f,t,t[0],m_),h=t[1].secondary_sidebar,_=ke(h,t,t[0],h_);return{c(){a&&a.c(),e=F(),n=D("div"),i=D("div"),u&&u.c(),s=F(),d&&d.c(),l=F(),_&&_.c(),E(i,"role","none"),E(i,"class","main-inner-main svelte-1msxade"),E(n,"role","none"),E(n,"class","main-inner svelte-1msxade")},m(p,b){a&&a.m(p,b),S(p,e,b),S(p,n,b),I(n,i),u&&u.m(i,null),I(i,s),d&&d.m(i,null),I(n,l),_&&_.m(n,null),r=!0},p(p,[b]){a&&a.p&&(!r||b&1)&&Se(a,o,p,p[0],r?ye(o,p[0],b,_P):Te(p[0]),g_),u&&u.p&&(!r||b&1)&&Se(u,c,p,p[0],r?ye(c,p[0],b,gP):Te(p[0]),p_),d&&d.p&&(!r||b&1)&&Se(d,f,p,p[0],r?ye(f,p[0],b,pP):Te(p[0]),m_),_&&_.p&&(!r||b&1)&&Se(_,h,p,p[0],r?ye(h,p[0],b,mP):Te(p[0]),h_)},i(p){r||(m(a,p),m(u,p),m(d,p),m(_,p),r=!0)},o(p){v(a,p),v(u,p),v(d,p),v(_,p),r=!1},d(p){p&&(y(e),y(n)),a&&a.d(p),u&&u.d(p),d&&d.d(p),_&&_.d(p)}}}function vP(t,e,n){let{$$slots:i={},$$scope:s}=e;return t.$$set=l=>{"$$scope"in l&&n(0,s=l.$$scope)},[s,i]}class Vk extends ie{constructor(e){super(),ne(this,e,vP,bP,te,{},hP)}}function wP(t){pe(t,"svelte-1wkhjew",'.outer.svelte-1wkhjew{flex:auto;display:flex;flex-direction:column;overflow:hidden}.outer.svelte-1wkhjew>[role="toolbar"]{flex:none}.outer.svelte-1wkhjew>[role="toolbar"] [role="search"]{flex:auto;width:auto;max-width:480px}.outer.svelte-1wkhjew .browser{flex:auto;display:flex;overflow:hidden}.outer.svelte-1wkhjew .primary-sidebar{display:flex;flex-direction:column;flex:none;width:240px;overflow-y:auto;background-color:var(--sui-tertiary-background-color);border-width:0 1px 0 0;border-color:var(--sui-primary-border-color)}.outer.svelte-1wkhjew .primary-sidebar [role="radiogroup"]{width:100%}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"]{gap:4px;margin:8px;border-width:0;background-color:transparent}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] button{display:flex;justify-content:flex-start;border-radius:var(--sui-control-medium-border-radius);width:100%;text-align:left}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] button span{flex:none}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] button span.label{flex:auto;overflow:hidden;text-overflow:ellipsis}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] button span.icon.check{display:none}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] button:not(:first-child){margin-top:4px}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] button:not(:focus){border-color:transparent}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] [role="option"][aria-selected="true"]{color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color)}.outer.svelte-1wkhjew .primary-sidebar [role="listbox"] [role="option"].dragover{color:var(--sui-primary-accent-color-inverted) !important;background-color:var(--sui-primary-accent-color) !important}.outer.svelte-1wkhjew .main{flex:auto;display:flex;flex-direction:column;overflow:hidden}.outer.svelte-1wkhjew .main .primary.global[role="toolbar"]{justify-content:center}.outer.svelte-1wkhjew .main .primary:not(.global)[role="toolbar"]{background-color:var(--sui-tertiary-background-color)}.outer.svelte-1wkhjew .main .secondary[role="toolbar"]{border-width:0 0 1px;border-color:var(--sui-primary-border-color)}')}const kP=t=>({}),__=t=>({}),yP=t=>({}),b_=t=>({});function SP(t){let e,n;const i=t[3].primary_sidebar,s=ke(i,t,t[4],b_),l=t[3].main,r=ke(l,t,t[4],__);return{c(){s&&s.c(),e=F(),r&&r.c()},m(o,a){s&&s.m(o,a),S(o,e,a),r&&r.m(o,a),n=!0},p(o,a){s&&s.p&&(!n||a&16)&&Se(s,i,o,o[4],n?ye(i,o[4],a,yP):Te(o[4]),b_),r&&r.p&&(!n||a&16)&&Se(r,l,o,o[4],n?ye(l,o[4],a,kP):Te(o[4]),__)},i(o){n||(m(s,o),m(r,o),n=!0)},o(o){v(s,o),v(r,o),n=!1},d(o){o&&y(e),s&&s.d(o),r&&r.d(o)}}}function TP(t){let e,n,i;const s=[{class:"browser "+t[0]},t[2]];let l={$$slots:{default:[SP]},$$scope:{ctx:t}};for(let r=0;r<s.length;r+=1)l=W(l,s[r]);return n=new rn({props:l}),{c(){e=D("div"),L(n.$$.fragment),E(e,"role","none"),E(e,"id","page-container"),E(e,"class","outer svelte-1wkhjew"),e.inert=t[1]},m(r,o){S(r,e,o),O(n,e,null),i=!0},p(r,[o]){const a=o&5?Re(s,[o&1&&{class:"browser "+r[0]},o&4&&Lt(r[2])]):{};o&16&&(a.$$scope={dirty:o,ctx:r}),n.$set(a),(!i||o&2)&&(e.inert=r[1])},i(r){i||(m(n.$$.fragment,r),i=!0)},o(r){v(n.$$.fragment,r),i=!1},d(r){r&&y(e),A(n)}}}function EP(t,e,n){const i=["class"];let s=re(e,i),l;B(t,jk,c=>n(1,l=c));let{$$slots:r={},$$scope:o}=e,{class:a=""}=e;return t.$$set=c=>{e=W(W({},e),Ve(c)),n(2,s=re(e,i)),"class"in c&&n(0,a=c.class),"$$scope"in c&&n(4,o=c.$$scope)},[a,l,s,r,o]}class zo extends ie{constructor(e){super(),ne(this,e,EP,TP,te,{class:0},wP)}}function OP(t){let e,n;return e=new NN({props:{slot:"primary_sidebar"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function AP(t){let e,n;return e=new jN({props:{slot:"primary_toolbar"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function LP(t){let e,n;return e=new dP({props:{slot:"secondary_toolbar"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function $P(t){let e,n;return e=new yN({props:{slot:"main_content"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function NP(t){let e,n;return e=new HN({props:{slot:"secondary_sidebar"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function PP(t){let e,n;return e=new Vk({props:{$$slots:{secondary_sidebar:[NP],main_content:[$P],secondary_toolbar:[LP],primary_toolbar:[AP]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function IP(t){let e,n;return e=new rn({props:{slot:"main",id:"assets-container",class:"main","aria-label":t[0]("x_asset_folder",{values:{folder:_r(t[2])}}),$$slots:{default:[PP]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&5&&(l["aria-label"]=i[0]("x_asset_folder",{values:{folder:_r(i[2])}})),s&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function v_(t){let e,n;return e=new j5({}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function CP(t){let e=t[0](t[3].count===1?"asset_saved":"assets_saved",{values:{count:t[3].count}})+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&9&&e!==(e=i[0](i[3].count===1?"asset_saved":"assets_saved",{values:{count:i[3].count}})+"")&&X(n,e)},d(i){i&&y(n)}}}function DP(t){let e,n;return e=new fl({props:{status:"success",$$slots:{default:[CP]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&8201&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function MP(t){let e=t[0](t[3].count===1?"asset_deleted":"assets_deleted",{values:{count:t[3].count}})+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&9&&e!==(e=i[0](i[3].count===1?"asset_deleted":"assets_deleted",{values:{count:i[3].count}})+"")&&X(n,e)},d(i){i&&y(n)}}}function jP(t){let e,n;return e=new fl({props:{status:"success",$$slots:{default:[MP]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,s){const l={};s&8201&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function RP(t){let e,n,i,s,l,r,o,a,c,u,f;e=new zo({props:{class:"media","aria-label":t[0]("asset_library"),$$slots:{main:[IP],primary_sidebar:[OP]},$$scope:{ctx:t}}});let d=t[1]&&v_();function h(g){t[6](g)}let _={$$slots:{default:[DP]},$$scope:{ctx:t}};t[3].saved!==void 0&&(_.show=t[3].saved),s=new Qs({props:_}),ae.push(()=>De(s,"show",h));function p(g){t[7](g)}let b={$$slots:{default:[jP]},$$scope:{ctx:t}};return t[3].deleted!==void 0&&(b.show=t[3].deleted),o=new Qs({props:b}),ae.push(()=>De(o,"show",p)),{c(){L(e.$$.fragment),n=F(),d&&d.c(),i=F(),L(s.$$.fragment),r=F(),L(o.$$.fragment)},m(g,w){O(e,g,w),S(g,n,w),d&&d.m(g,w),S(g,i,w),O(s,g,w),S(g,r,w),O(o,g,w),c=!0,u||(f=We(window,"hashchange",t[5]),u=!0)},p(g,[w]){const k={};w&1&&(k["aria-label"]=g[0]("asset_library")),w&8197&&(k.$$scope={dirty:w,ctx:g}),e.$set(k),g[1]?d?w&2&&m(d,1):(d=v_(),d.c(),m(d,1),d.m(i.parentNode,i)):d&&(H(),v(d,1,1,()=>{d=null}),V());const T={};w&8201&&(T.$$scope={dirty:w,ctx:g}),!l&&w&8&&(l=!0,T.show=g[3].saved,je(()=>l=!1)),s.$set(T);const P={};w&8201&&(P.$$scope={dirty:w,ctx:g}),!a&&w&8&&(a=!0,P.show=g[3].deleted,je(()=>a=!1)),o.$set(P)},i(g){c||(m(e.$$.fragment,g),m(d),m(s.$$.fragment,g),m(o.$$.fragment,g),c=!0)},o(g){v(e.$$.fragment,g),v(d),v(s.$$.fragment,g),v(o.$$.fragment,g),c=!1},d(g){g&&(y(n),y(i),y(r)),A(e,g),d&&d.d(g),A(s,g),A(o,g),u=!1,f()}}}function FP(t,e,n){let i,s,l,r,o,a,c,u;B(t,me,b=>n(0,i=b)),B(t,el,b=>n(1,s=b)),B(t,In,b=>n(9,l=b)),B(t,an,b=>n(10,r=b)),B(t,mi,b=>n(2,o=b)),B(t,gl,b=>n(11,a=b)),B(t,_i,b=>n(12,c=b)),B(t,no,b=>n(3,u=b));let f="";const d=()=>{({path:f}=Ro());const[b,g,w]=f.match(/^\/assets(?:\/([/\-\w]+))?(?:\/([^/]+.\w{3,4}))?$/)??[];if(b){if(g?c.some(({internalPath:k})=>g===k)&&o!==g&&$e(mi,o=g,o):$e(mi,o="",o),!w){const k=a.length;$e(el,s=null,s),$e(In,l=i(k>1?"viewing_x_asset_folder_many_assets":k===1?"viewing_x_asset_folder_one_asset":"viewing_x_asset_folder_no_asset",{values:{folder:_r(o),count:k}}),l);return}$e(el,s=f.match(/^\/assets\/(.+?)\.[a-zA-Z0-9]+$/)?r.find(k=>k.path===`${g}/${w}`)??null:null,s),$e(In,l=s?i("viewing_x_asset_details",{values:{name:s.name}}):i("file_not_found"),l)}};ln(()=>{d()});const h=()=>{d()};function _(b){t.$$.not_equal(u.saved,b)&&(u.saved=b,no.set(u))}function p(b){t.$$.not_equal(u.deleted,b)&&(u.deleted=b,no.set(u))}return[i,s,o,u,d,h,_,p]}class zP extends ie{constructor(e){super(),ne(this,e,FP,RP,te,{})}}function BP(t){let e=t[1]("confirm_uploading_files",{values:{count:t[3].files.length,folder:`/${t[3].folder}`}})+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&10&&e!==(e=i[1]("confirm_uploading_files",{values:{count:i[3].files.length,folder:`/${i[3].folder}`}})+"")&&X(n,e)},d(i){i&&y(n)}}}function UP(t){let e=t[1]("confirm_uploading_file",{values:{folder:`/${t[3].folder}`}})+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&10&&e!==(e=i[1]("confirm_uploading_file",{values:{folder:`/${i[3].folder}`}})+"")&&X(n,e)},d(i){i&&y(n)}}}function qP(t){let e,n,i,s,l;function r(f,d){return f[3].files.length===1?UP:BP}let o=r(t),a=o(t);function c(f){t[4](f)}let u={};return t[3].files!==void 0&&(u.files=t[3].files),i=new Ah({props:u}),ae.push(()=>De(i,"files",c)),{c(){e=D("div"),a.c(),n=F(),L(i.$$.fragment),E(e,"role","none")},m(f,d){S(f,e,d),a.m(e,null),S(f,n,d),O(i,f,d),l=!0},p(f,d){o===(o=r(f))&&a?a.p(f,d):(a.d(1),a=o(f),a&&(a.c(),a.m(e,null)));const h={};!s&&d&8&&(s=!0,h.files=f[3].files,je(()=>s=!1)),i.$set(h)},i(f){l||(m(i.$$.fragment,f),l=!0)},o(f){v(i.$$.fragment,f),l=!1},d(f){f&&(y(e),y(n)),a.d(),A(i,f)}}}function HP(t){let e,n;return e=new Oo({props:{open:t[0],title:t[1]("upload_files"),okLabel:t[1](t[2]==="local"?"save":"upload"),$$slots:{default:[qP]},$$scope:{ctx:t}}}),e.$on("ok",t[5]),e.$on("cancel",t[6]),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&1&&(l.open=i[0]),s&2&&(l.title=i[1]("upload_files")),s&6&&(l.okLabel=i[1](i[2]==="local"?"save":"upload")),s&138&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function VP(t,e,n){let i,s,l,r;B(t,sO,u=>n(0,i=u)),B(t,me,u=>n(1,s=u)),B(t,Mo,u=>n(2,l=u)),B(t,Bn,u=>n(3,r=u));function o(u){t.$$.not_equal(r.files,u)&&(r.files=u,Bn.set(r))}return[i,s,l,r,o,async()=>{await H$(r,{commitType:"uploadMedia"}),$e(Bn,r={folder:void 0,files:[]},r)},()=>{$e(Bn,r={folder:void 0,files:[]},r)}]}class YP extends ie{constructor(e){super(),ne(this,e,VP,HP,te,{})}}function GP(t){pe(t,"svelte-soravq","div.svelte-soravq{flex:auto;overflow:auto}pre.svelte-soravq{margin:0;padding:16px}")}function WP(t){let e,n,i=ur.stringify(t[1])+"",s,l;return{c(){e=D("div"),n=D("pre"),s=K(i),E(n,"class","svelte-soravq"),E(e,"aria-label",l=t[0]("site_config")),E(e,"class","svelte-soravq")},m(r,o){S(r,e,o),I(e,n),I(n,s)},p(r,o){o&2&&i!==(i=ur.stringify(r[1])+"")&&X(s,i),o&1&&l!==(l=r[0]("site_config"))&&E(e,"aria-label",l)},d(r){r&&y(e)}}}function KP(t){let e,n;return e=new zo({props:{class:"content","aria-label":t[0]("site_configuration_editor"),$$slots:{main:[WP]},$$scope:{ctx:t}}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p(i,[s]){const l={};s&1&&(l["aria-label"]=i[0]("site_configuration_editor")),s&7&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function ZP(t,e,n){let i,s;return B(t,me,l=>n(0,i=l)),B(t,Ot,l=>n(1,s=l)),[i,s]}class XP extends ie{constructor(e){super(),ne(this,e,ZP,KP,te,{},GP)}}const JP={collections:"Collections",contents:"Contents",entries:"Entries",assets:"Assets",media:"Media",workflow:"Workflow",editorial_workflow:"Editorial Workflow",notifications:"Notifications",site_config:"Site Configuration",settings:"Settings",account:"Account",live_site:"Live Site",git_repository:"Git Repository",help:{keyboard_shortcuts:"Keyboard Shortcuts",documentation:"Documentation",release_notes:"Release Notes",issue:"Report Issue",feedback:"Share Feedback"},user_name:"User Name",password:"Password",sign_in:"Sign In",sign_in_with_x:"Sign In with {service}",signed_in_as_x:"Signed In as {name}",work_with_local_repo:"Work with Local Repository",working_with_local_repo:"Working with Local Repository",sign_out:"Sign Out",create:"New",select:"Select",select_all:"Select All",clear_selection:"Clear Selection",upload:"Upload",copy:"Copy",download:"Download",delete:"Delete",save:"Save",saving:"Saving…",replace:"Replace",remove:"Remove",remove_x:"Remove {name}",clear:"Clear",expand:"Expand",collapse:"Collapse",insert:"Insert",searching:"Searching…",global:"Global",primary:"Primary",secondary:"Secondary",collection:"Collection",folder:"Folder",api_key:"API Key",welcome_to_sveltia_cms:"Welcome to Sveltia CMS",loading_site_config:"Loading Site Configuration…",loading_site_data:"Loading Site Data…",loading_site_data_error:"There was an error while loading site data.",unexpected_error:"Unexpected Error",visit_live_site:"Visit Live Site",switch_page:"Switch Page",search_placeholder:"Search for entries and assets…",create_entry_or_asset:"Create Entry or Asset",asset:"Asset",show_notifications:"Show Notifications",show_account_menu:"Show Account Menu",content_library:"Content Library",asset_library:"Asset Library",collection_assets:"Collection Assets",entry_list:"Entry List",file_list:"File List",asset_list:"Asset List",x_collection:"“{collection}” Collection",x_asset_folder:"“{folder}” Asset Folder",viewing_x_collection_many_entries:"You’re now viewing the “{collection}” collection, which has {count} entries.",viewing_x_collection_one_entry:"You’re now viewing the “{collection}” collection, which has one entry.",viewing_x_collection_no_entry:"You’re now viewing the “{collection}” collection, which has no entry yet.",viewing_x_asset_folder_many_assets:"You’re now viewing the “{folder}” asset folder, which has {count} assets.",viewing_x_asset_folder_one_asset:"You’re now viewing the “{folder}” asset folder, which has one asset.",viewing_x_asset_folder_no_asset:"You’re now viewing the “{folder}” asset folder, which has no asset yet.",collection_not_found:"Collection not found",file_not_found:"File not found.",switch_view:"Switch View",list_view:"List View",grid_view:"Grid View",sort:"Sort",sorting_options:"Sorting Options",sort_keys:{none:"None",name:"Name",commit_author:"Updated by",commit_date:"Updated on"},ascending:"{label}, A to Z",ascending_date:"{label}, old to new",descending:"{label}, Z to A",descending_date:"{label}, new to old",filter:"Filter",filtering_options:"Filtering Options",group:"Group",grouping_options:"Grouping Options",file_type:"File Type",all:"All",image:"Image",video:"Video",audio:"Audio",document:"Document",other:"Other",show_assets:"Show Assets",hide_assets:"Hide Assets",show_info:"Show Info",hide_info:"Hide Info",asset_folders:"Asset Folders",all_assets:"All Assets",uncategorized:"Uncategorized",search_results_for_x:"Search Results for “{terms}”",viewing_search_results:"You’re now viewing search results for “{terms}”. We’ve found {entries} and {assets}.",many_entries:"{count} entries",one_entry:"one entry",no_entry:"no entry",many_assets:"{count} assets",one_asset:"one asset",no_asset:"no asset",no_files_found:"No files found.",no_entries_found:"No entries found.",drop_files_or_browse:"Drop a file here or click to browse:",drop_files_here:"Drop files here",delete_asset:"Delete Asset",delete_assets:"Delete Assets",delete_selected_asset:"Delete Selected Asset",delete_selected_assets:"Delete Selected Assets",confirm_deleting_this_asset:"Are you sure to delete this asset?",confirm_deleting_selected_asset:"Are you sure to delete the selected asset?",confirm_deleting_selected_assets:"Are you sure to delete the selected {count} assets?",confirm_deleting_all_assets:"Are you sure to delete all the assets?",delete_entry:"Delete Entry",delete_entries:"Delete Entries",delete_selected_entry:"Delete Selected Entry",delete_selected_entries:"Delete Selected Entries",confirm_deleting_this_entry:"Are you sure to delete this entry?",confirm_deleting_selected_entry:"Are you sure to delete the selected entry?",confirm_deleting_selected_entries:"Are you sure to delete the selected {count} entries?",confirm_deleting_all_entries:"Are you sure to delete all the entries?",upload_files:"Upload New Files",confirm_uploading_file:"Are you sure to save the following file to the “{folder}” folder?",confirm_uploading_files:"Are you sure to save the following {count} files to the “{folder}” folder?",no_entries_created:"This collection has no entries yet.",create_new_entry:"Create New Entry",no_files_in_collection:"No files available in this collection.",asset_info:"Asset Info",select_asset_show_info:"Select an asset to show the info.",duplicate_entry:"Duplicate Entry",entry_duplicated:"Entry has been duplicated. It’s now a new draft.",entry_validation_error:"One field has an error. Please correct it to save the entry.",entry_validation_errors:"{count} fields have an error. Please correct them to save the entry.",entry_saved:"Entry has been saved.",entry_deleted:"Entry has been deleted.",entries_deleted:"{count} entries have been deleted.",asset_saved:"Asset has been saved.",assets_saved:"{count} assets have been saved.",asset_deleted:"Asset has been deleted.",assets_deleted:"{count} assets have been deleted.",content_editor:"Content Editor",cancel_editing:"Cancel Editing",creating_x:"Creating {name}",creating_x_collection_entry:"You’re now creating a new entry in the “{collection}” collection.",editing_x_in_x:"Editing {collection} / {entry}",editing_x_collection_entry:"You’re now editing the “{entry}” entry in the “{collection}” collection.",editing_x_collection_file:"You’re now editing the “{file}” file in the “{collection}” collection.",show_editor_options:"Show Editor Options",editor_options:"Editor Options",show_preview:"Show Preview",sync_scrolling:"Sync Scrolling",switch_locale:"Switch Locale",locale_content_errors:"One more more fields in this locale content have an error.",edit:"Edit",preview:"Preview",edit_x_locale:"Edit {locale} Content",preview_x_locale:"Preview {locale} Content",content_preview:"Content Preview",show_content_options_x_locale:"Show {locale} Content Options",content_options_x_locale:"{locale} Content Options",x_field:"“{field}” Field",show_field_options:"Show Field Options",field_options:"Field Options",unsupported_widget_x:"Unsupported widget: {name}",enable_x_locale:"Enable {locale}",reenable_x_locale:"Reenable {locale}",disable_x_locale:"Disable {locale}",locale_x_has_been_disabled:"The {locale} content has been disabled.",locale_x_now_disabled:"The {locale} content is now disabled. It will be deleted when you save the entry.",copy_from:"Copy from…",copy_from_x:"Copy from {locale}",translate_from:"Translate from…",translate_from_x:"Translate from {locale}",revert_changes:"Revert Changes",revert_all_changes:"Revert All Changes",required:"Required",editor:{translation:{none:"Nothing has been translated.",started:"Translating…",error:"There was an error while translating.",complete:{one:"Translated the field from {source}.",many:"Translated {count} fields from {source}."}},copy:{none:"Nothing has been copied.",complete:{one:"Copied the field from {source}.",many:"Copied {count} fields from {source}."}}},validation:{value_missing:"This field is required.",range_underflow:{select_many:"You have to select at least {min} item.",select_one:"You have to select at least {min} items.",add_many:"You have to add at least {min} item.",add_one:"You have to add at least {min} items."},range_overflow:{select_many:"You cannot select more than {max} item.",select_one:"You cannot select more than {max} items.",add_many:"You cannot add more than {max} item.",add_one:"You cannot add more than {max} items."}},saving_entry:{error:{title:"Error",description:"There was an error while saving the entry. Please try again later."}},viewing_x_asset_details:"You’re viewing the details of the “{name}” asset.",asset_editor:"Asset Editor",no_preview_available:"No Preview Available.",public_url:"Public URL",file_path:"File Path",kind:"Kind",size:"Size",dimensions:"Dimensions",duration:"Duration",used_in:"Used in",select_file:"Select File",select_image:"Select Image",replace_file:"Replace File",replace_image:"Replace Image",remove_file:"Remove File",remove_image:"Remove Image",remove_this_item:"Remove This Item",move_up:"Move Up",move_down:"Move Down",add_x:"Add {name}",select_list_type:"Select List Type",assets_dialog:{title:{file:"Select File",image:"Select Image"},search_for_file:"Search for Files",search_for_image:"Search for Images",locations:"Locations",location:{this_repository:"This Repository",external_locations:"External Locations",stock_photos:"Stock Photos"},error:{invalid_key:"Your API Key is invalid or expired. Please double check and try again.",search_fetch_failed:"There was an error while searching assets. Please try again later.",image_fetch_failed:"There was an error while downloading the selected asset. Please try again later."},available_images:"Available Images",enter_url:"Enter URL",enter_file_url:"Enter URL of the file:",enter_image_url:"Enter URL of the image:",large_file:{title:"Large File",description:"This file exceeds the maximum size of {size}. Please choose another."},photo_credit:{title:"Photo Credit",description:"Use the following credit if possible:"}},boolean:{true:"Yes",false:"No"},cloud_storage:{invalid:"The service is not configured properly.",auth:{initial:"Sign into {service} to insert media on the storage to entry fields.",requested:"Signing in…",error:"User name or password is incorrect. Please double check and try again."}},config:{error:{fetch_failed:"The configuration file could not be retrieved.",parse_failed:"The configuration file could not be parsed.",no_collection:"Collections are not defined in the configuration file.",no_backend:"The backend is not defined in the configuration file.",unsupported_backend:"The configured “{name}” backend is not supported.",no_media_folder:"The media folder is not defined in the configuration file.",unexpected:"There was an unexpected error while validating the configuration file.",try_again:"Please solve the issue and try again."}},unsupported:{browser:"Local development is not supported in your browser. Please use Chrome or Edge instead."},status:{drafts:"Drafts",in_review:"In Review",ready:"Ready"},categories:"Categories",prefs:{error:{permission_denied:"Browser storage (Cookie) access has been denied. Please check the permission and try again."},appearance:{title:"Appearance",theme:"Theme",select_theme:"Select Theme"},theme:{auto:"Auto",dark:"Dark",light:"Light"},languages:{title:"Languages",ui_language:{title:"User Interface Language",select_language:"Select Language"},translator:{title:"{service} Translator",field_label:"{service} API Authentication Key",description:"Sign up for <a {homeHref}>{service} API</a> and enter <a {apiKeyHref}>your Authentication Key</a> here to enable quick translation of text entry fields."}},media:{title:"Media",stock_photos:{title:"{service} Free Images",field_label:"{service} API Key",description:"Sign up for <a {homeHref}>{service} API</a> and enter <a {apiKeyHref}>your API Key</a> here to insert free stock photos to image entry fields.",credit:"Photos provided by {service}"}},advanced:{title:"Advanced",developer_mode:{title:"Developer Mode",description:"Enable some features, including detailed console logs and native context menus.",switch_label:"Enable Developer Mode"}}},keyboard_shortcuts:{search:"Search for entries and assets",create_entry:"Create a new entry",save_entry:"Save an entry"},file_type_labels:{avif:"AVIF image",bmp:"Bitmap image",gif:"GIF image",ico:"Icon",jpeg:"JPEG image",jpg:"JPEG image",png:"PNG image",svg:"SVG image",tif:"TIFF image",tiff:"TIFF image",webp:"WebP image",avi:"AVI video",mp4:"MP4 video",mpeg:"MPEG video",ogv:"OGG video",ts:"MPEG video",webm:"WebM video","3gp":"3GPP video","3g2":"3GPP2 video",aac:"AAC audio",mid:"MIDI",midi:"MIDI",mp3:"MP3 audio",opus:"OPUS audio",wav:"WAV audio",weba:"WebM audio",csv:"CSV spreadsheet",doc:"Word document",docx:"Word document",odp:"OpenDocument presentation",ods:"OpenDocument spreadsheet",odt:"OpenDocument text",pdf:"PDF document",ppt:"PowerPoint presentation",pptx:"PowerPoint presentation",rtf:"Rich text document",xls:"Excel spreadsheet",xlsx:"Excel spreadsheet"}},QP=Object.freeze(Object.defineProperty({__proto__:null,strings:JP},Symbol.toStringTag,{value:"Module"})),xP={collections:"コレクション",contents:"コンテンツ",entries:"エントリー",assets:"アセット",media:"メディア",workflow:"ワークフロー",editorial_workflow:"編集ワークフロー",notifications:"通知",site_config:"サイト設定",settings:"設定",account:"アカウント",live_site:"管理対象サイト",git_repository:"Git レポジトリ",help:{keyboard_shortcuts:"キーボードショートカット",documentation:"ドキュメンテーション",release_notes:"リリースノート",issue:"問題を報告",feedback:"フィードバックを共有"},user_name:"ユーザー名",password:"パスワード",sign_in:"ログイン",sign_in_with_x:"{service} でログイン",signed_in_as_x:"{name} としてログイン中",work_with_local_repo:"ローカルレポジトリで作業",working_with_local_repo:"ローカルレポジトリで作業中",sign_out:"ログアウト",create:"新規作成",select:"選択",select_all:"すべて選択",clear_selection:"選択を解除",upload:"アップロード",copy:"コピー",download:"ダウンロード",delete:"削除",save:"保存",saving:"保存中…",replace:"置き換え",remove:"削除",remove_x:"{name} を削除",clear:"クリア",expand:"広げる",collapse:"折り畳む",insert:"挿入",searching:"検索中…",global:"グローバル",primary:"プライマリー",secondary:"セカンダリー",collection:"コレクション",folder:"フォルダー",api_key:"API キー",welcome_to_sveltia_cms:"Sveltia CMS へようこそ",loading_site_config:"サイト設定を読み込んでいます…",loading_site_data:"サイトデータを読み込んでいます…",loading_site_data_error:"サイトデータの読み込み中にエラーが発生しました。",unexpected_error:"予期せぬエラー",visit_live_site:"管理対象サイトを開く",switch_page:"ページを切り替え",search_placeholder:"エントリーとアセットを検索…",create_entry_or_asset:"エントリーまたはアセットを作成",asset:"アセット",show_notifications:"通知を表示",show_account_menu:"アカウントメニューを表示",content_library:"コンテンツライブラリ",asset_library:"アセットライブラリ",collection_assets:"コレクションアセット",entry_list:"エントリーリスト",file_list:"ファイルリスト",asset_list:"アセットリスト",x_collection:"「{collection}」コレクション",x_asset_folder:"「{folder}」アセットフォルダー",viewing_x_collection_many_entries:"「{collection}」コレクションを表示しています。ここには {count} 個のエントリーがあります。",viewing_x_collection_one_entry:"「{collection}」コレクションを表示しています。ここにはひとつのエントリーがあります。",viewing_x_collection_no_entry:"「{collection}」コレクションを表示しています。ここにはまだエントリーがありません。",viewing_x_asset_folder_many_assets:"「{folder}」アセットフォルダーを表示しています。ここには {count} 個のアセットがあります。",viewing_x_asset_folder_one_asset:"「{folder}」アセットフォルダーを表示しています。ここにはひとつのアセットがあります。",viewing_x_asset_folder_no_assets:"「{folder}」アセットフォルダーを表示しています。ここにはまだアセットがありません。",collection_not_found:"コレクションが見つかりませんでした",file_not_found:"ファイルが見つかりませんでした",switch_view:"ビューを切り替え",list_view:"リストビュー",grid_view:"グリッドビュー",sort:"並び替え",sorting_options:"並べ替えオプション",sort_keys:{none:"なし",name:"名前",commit_author:"更新者",commit_date:"更新日時"},ascending:"{label} (A–Z)",ascending_date:"{label} (古い順)",descending:"{label} (Z–A)",descending_date:"{label} (新しい順)",filter:"絞り込み",filtering_options:"絞り込みオプション",group:"グループ化",grouping_options:"グループ化オプション",file_type:"ファイル形式",all:"すべて",image:"画像",video:"動画",audio:"音声",document:"書類",other:"その他",show_assets:"アセットを表示",hide_assets:"アセットを隠す",show_info:"情報を表示",hide_info:"情報を隠す",asset_folders:"アセットフォルダー",all_assets:"すべてのアセット",uncategorized:"未分類",search_results_for_x:"「{terms}」の検索結果",viewing_search_results:"「{terms}」の検索結果を表示しています。{entries} と {assets} が見つかりました。",many_entries:"{count} 個のエントリー",one_entry:"1 個のエントリー",no_entry:"0 個のエントリー",many_assets:"{count} 個のアセット",one_asset:"1 個のアセット",no_asset:"0 個のアセット",no_files_found:"ファイルは見つかりませんでした。",no_entries_found:"エントリーは見つかりませんでした。",drop_files_or_browse:"ここにファイルをドロップするか下のボタンをクリックして参照:",drop_files_here:"ここにファイルをドロップ",delete_asset:"アセットを削除",delete_assets:"アセットを削除",delete_selected_asset:"選択されたアセットを削除",delete_selected_assets:"選択されたアセットを削除",confirm_deleting_this_asset:"このアセットを削除してもよろしいですか?",confirm_deleting_selected_asset:"選択されたファイルを削除してもよろしいですか?",confirm_deleting_selected_assets:"選択された {count} 個のファイルを削除してもよろしいですか?",confirm_deleting_all_assets:"すべてのアセットを削除してもよろしいですか?",delete_entry:"エントリーを削除",delete_entries:"エントリーを削除",delete_selected_entry:"選択されたエントリーを削除",delete_selected_entries:"選択されたエントリーを削除",confirm_deleting_this_entry:"このエントリーを削除してもよろしいですか?",confirm_deleting_selected_entry:"選択されたエントリーを削除してもよろしいですか?",confirm_deleting_selected_entries:"選択された {count} 個のエントリーを削除してもよろしいですか?",confirm_deleting_all_entries:"すべてのエントリーを削除してもよろしいですか?",upload_files:"新しいファイルをアップロード",confirm_uploading_file:"以下のファイルを「{folder}」フォルダーに保存してもよろしいですか?",confirm_uploading_files:"以下の {count} 個のファイルを「{folder}」フォルダーに保存してもよろしいですか?",no_entries_created:"このコレクションにはまだエントリーがありません。",create_new_entry:"新しいエントリーを作成",no_files_in_collection:"このコレクションにはファイルがありません。",asset_info:"アセット情報",select_asset_show_info:"アセットを選択すると情報が表示されます。",duplicate_entry:"エントリーを複製",entry_duplicated:"エントリーが複製され、新しい下書きとなりました。",entry_validation_error:"ひとつのフィールドにエラーがあります。エントリーを保存するには問題を修正してください。",entry_validation_errors:"{count} 個のフィールドにエラーがあります。エントリーを保存するには問題を修正してください。",entry_saved:"エントリーが保存されました。",entry_deleted:"エントリーが削除されました。",entries_deleted:"{count} 個のエントリーが削除されました。",asset_saved:"アセットが保存されました。",assets_saved:"{count} 個のアセットが保存されました。",asset_deleted:"アセットが削除されました。",assets_deleted:"{count} 個のアセットが削除されました。",content_editor:"コンテンツエディター",cancel_editing:"編集をキャンセル",creating_x:"{name} を作成",creating_x_collection_entry:"「{collection}」コレクションの新しいエントリーを作成しています。",editing_x_in_x:"{collection} / {entry} を編集",editing_x_collection_entry:"「{collection}」コレクションの「{entry}」エントリーを編集しています。",editing_x_collection_file:"「{collection}」コレクションの「{file}」ファイルを編集しています。",show_editor_options:"エディターオプションを表示",editor_options:"エディターオプション",show_preview:"プレビューを表示",sync_scrolling:"スクロールを同期",switch_locale:"ロケールを切り替え",locale_content_errors:"このロケールコンテンツのひとつか複数のフィールドにエラーがあります。",edit:"編集",preview:"プレビュー",edit_x_locale:"{locale} コンテンツを編集",preview_x_locale:"{locale} コンテンツをプレビュー",content_preview:"コンテンツプレビュー",show_content_options_x_locale:"{locale} コンテンツのオプションを表示",content_options_x_locale:"{locale} コンテンツのオプション",x_field:"「{field}」フィールド",show_field_options:"フィールドオプションを表示",field_options:"フィールドオプション",unsupported_widget_x:"非対応ウィジェット: {name}",enable_x_locale:"{locale} を有効化",reenable_x_locale:"{locale} を再度有効化",disable_x_locale:"{locale} を無効化",locale_x_has_been_disabled:"{locale} コンテンツは無効化されています。",locale_x_now_disabled:"{locale} コンテンツは無効化されました。エントリーを保存する際に削除されます。",copy_from:"他の言語からコピー…",copy_from_x:"{locale} からコピー",translate_from:"他の言語から翻訳…",translate_from_x:"{locale} から翻訳",revert_changes:"変更を取り消す",revert_all_changes:"すべての変更を取り消す",required:"必須",editor:{translation:{none:"翻訳されたフィールドはありません。",started:"翻訳中…",error:"翻訳中に問題が発生しました。",complete:{one:"{source} からフィールドを翻訳しました。",many:"{source} から {count} 個のフィールドを翻訳しました。"}},copy:{none:"コピーされたフィールドはありません。",complete:{one:"{source} からフィールドをコピーしました。",many:"{source} から {count} 個のフィールドをコピーしました。"}}},validation:{value_missing:"この項目は必須です。",range_underflow:{select_many:"少なくとも {min} 個の項目を選択してください。",select_one:"少なくとも {min} 個の項目を選択してください。",add_many:"少なくとも {min} 個の項目を追加してください。",add_one:"少なくとも {min} 個の項目を追加してください。"},range_overflow:{select_many:"選択できるのは最大で {max} 項目です。",select_one:"選択できるのは最大で {max} 項目です。",add_many:"追加できるのは最大で {max} 項目です。",add_one:"追加できるのは最大で {max} 項目です。"}},saving_entry:{error:{title:"エラー",description:"エントリーを保存中に問題が発生しました。後で再度お試しください。"}},viewing_x_asset_details:"「{name}」アセットの詳細を表示しています。",asset_editor:"アセットエディター",no_preview_available:"プレビューは表示できません",public_url:"公開 URL",file_path:"ファイルパス",kind:"種類",size:"サイズ",dimensions:"大きさ",duration:"再生時間",used_in:"使われているエントリー",select_file:"ファイルを選択",select_image:"画像を選択",replace_file:"ファイルを差し替え",replace_image:"画像を差し替え",remove_file:"ファイルを削除",remove_image:"画像を削除",remove_this_item:"このアイテムを削除",move_up:"上へ移動",move_down:"下へ移動",add_x:"{name} を追加",select_list_type:"リストタイプを選択",assets_dialog:{title:{file:"ファイルを選択",image:"画像を選択"},search_for_file:"ファイルを検索",search_for_image:"画像を検索",locations:"場所",location:{this_repository:"このレポジトリ",external_locations:"外部の場所",stock_photos:"ストックフォト"},error:{invalid_key:"あなたの API キーは正しくないか期限切れです。確認の上、再度お試しください。",search_fetch_failed:"アセットを検索中に問題が発生しました。後で再度お試しください。",image_fetch_failed:"選択されたアセットをダウンロード中に問題が発生しました。後で再度お試しください。"},available_images:"利用可能な画像",enter_url:"URL を入力",enter_file_url:"ファイルの URL を入力:",enter_image_url:"画像の URL を入力:",large_file:{title:"大きなファイル",description:"このファイルは最大サイズ {size} を超えています。他のファイルを選んでください。"},photo_credit:{title:"写真クレジット",description:"可能であれば以下のクレジットを使ってください:"}},boolean:{true:"はい",false:"いいえ"},cloud_storage:{invalid:"このサービスは正しく設定されていません。",auth:{initial:"{service} へログインすると、ストレージ上のメディアをエントリー項目へ挿入できます。",requested:"ログイン中…",error:"ユーザー名またはパスワードが間違っています。確認の上、再度お試しください。"}},config:{error:{fetch_failed:"設定ファイルを読み込めませんでした。",parse_failed:"設定ファイルを解析できませんでした。",no_collection:"設定ファイル内でコレクションが定義されていません。",no_backend:"設定ファイル内でバックエンドが定義されていません。",unsupported_backend:"設定されている「{name}」バックエンドは非対応です。",no_media_folder:"設定ファイル内でメディアフォルダーが定義されていません。",unexpected:"設定ファイルを検証中に予期せぬ問題が発生しました。",try_again:"問題を解決してから再度お試しください。"}},unsupported:{browser:"お使いのブラウザーはローカル開発に対応していません。代わりに Chrome か Edge を使ってください。"},status:{drafts:"下書き",in_review:"レビュー中",ready:"公開可"},categories:"カテゴリ",prefs:{error:{permission_denied:"ブラウザーストレージ (Cookie) アクセスが拒否されました。許可設定を確認の上、再度お試しください。"},appearance:{title:"アピアランス",theme:"テーマ",select_theme:"テーマを選択"},theme:{auto:"自動",dark:"ダーク",light:"ライト"},languages:{title:"言語",ui_language:{title:"ユーザーインターフェース言語",select_language:"言語を選択"},translator:{title:"{service} 翻訳",field_label:"{service} API 認証キー",description:"<a {homeHref}>{service} API</a> にユーザー登録して、<a {apiKeyHref}>発行された認証キー</a> をここに入力すると、テキストエントリー項目の素早い翻訳が可能となります。"}},media:{title:"メディア",stock_photos:{title:"{service} 無料画像素材",field_label:"{service} API キー",description:"<a {homeHref}>{service} API</a> にユーザー登録して、<a {apiKeyHref}>発行された API キー</a> をここに入力すると、画像エントリー項目に無料のストックフォトを挿入できます。",credit:"写真提供: {service}"}},advanced:{title:"詳細",developer_mode:{title:"開発者モード",description:"詳細なコンソールログやネイティブコンテキストメニューなど、いくつかの機能を有効化します。",switch_label:"開発者モードを有効にする"}}},keyboard_shortcuts:{search:"エントリーとアセットを検索",create_entry:"新しいエントリーを作成",save_entry:"エントリーを保存"},file_type_labels:{avif:"AVIF 画像",bmp:"Bitmap 画像",gif:"GIF 画像",ico:"アイコン",jpeg:"JPEG 画像",jpg:"JPEG 画像",png:"PNG 画像",svg:"SVG 画像",tif:"TIFF 画像",tiff:"TIFF 画像",webp:"WebP 画像",avi:"AVI 動画",mp4:"MP4 動画",mpeg:"MPEG 動画",ogv:"OGG 動画",ts:"MPEG 動画",webm:"WebM 動画","3gp":"3GPP 動画","3g2":"3GPP2 動画",aac:"AAC 音声",mid:"MIDI",midi:"MIDI",mp3:"MP3 音声",opus:"OPUS 音声",wav:"WAV 音声",weba:"WebM 音声",csv:"CSV スプレッドシート",doc:"Word ドキュメント",docx:"Word ドキュメント",odp:"OpenDocument プレゼンテーション",ods:"OpenDocument スプレッドシート",odt:"OpenDocument テキスト",pdf:"PDF ドキュメント",ppt:"PowerPoint プレゼンテーション",pptx:"PowerPoint プレゼンテーション",rtf:"リッチテキストドキュメント",xls:"Excel スプレッドシート",xlsx:"Excel スプレッドシート"}},eI=Object.freeze(Object.defineProperty({__proto__:null,strings:xP},Symbol.toStringTag,{value:"Module"})),tI=()=>{Object.entries(Object.assign({"../locales/en.js":QP,"../locales/ja.js":eI})).forEach(([e,{strings:n}])=>{const[,i]=e.match(/([a-zA-Z-]+)\.js/);$d(i,n)}),dv({fallbackLocale:"en",initialLocale:(f4()??"").split("-")[0]||"en"})},Gn=t=>{try{return new Intl.DisplayNames(le(xt),{type:"language"}).of(t)}catch{return t}};function w_(t,e,n){const i=t.slice();return i[22]=e[n],i}function k_(t){let e,n;function i(){return t[18](t[22])}return e=new zt({props:{label:t[8](t[2]?"translate_from_x":"copy_from_x",{values:{locale:Gn(t[22])}}),disabled:!t[7][t[0]]||!t[7][t[22]]||t[1]&&!t[6][t[22]][t[1]]||!t[2]&&t[1]&&t[6][t[22]][t[1]]===t[6][t[0]][t[1]]||t[2]&&(!t[4].includes(t[0].toUpperCase())||!t[3].includes(t[22].toUpperCase()))}}),e.$on("click",i),{c(){L(e.$$.fragment)},m(s,l){O(e,s,l),n=!0},p(s,l){t=s;const r={};l&292&&(r.label=t[8](t[2]?"translate_from_x":"copy_from_x",{values:{locale:Gn(t[22])}})),l&255&&(r.disabled=!t[7][t[0]]||!t[7][t[22]]||t[1]&&!t[6][t[22]][t[1]]||!t[2]&&t[1]&&t[6][t[22]][t[1]]===t[6][t[0]][t[1]]||t[2]&&(!t[4].includes(t[0].toUpperCase())||!t[3].includes(t[22].toUpperCase()))),e.$set(r)},i(s){n||(m(e.$$.fragment,s),n=!0)},o(s){v(e.$$.fragment,s),n=!1},d(s){A(e,s)}}}function nI(t){let e,n,i=fe(t[5]),s=[];for(let r=0;r<i.length;r+=1)s[r]=k_(w_(t,i,r));const l=r=>v(s[r],1,1,()=>{s[r]=null});return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=x()},m(r,o){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(r,o);S(r,e,o),n=!0},p(r,[o]){if(o&1023){i=fe(r[5]);let a;for(a=0;a<i.length;a+=1){const c=w_(r,i,a);s[a]?(s[a].p(c,o),m(s[a],1)):(s[a]=k_(c),s[a].c(),m(s[a],1),s[a].m(e.parentNode,e))}for(H(),a=i.length;a<s.length;a+=1)l(a);V()}},i(r){if(!n){for(let o=0;o<i.length;o+=1)m(s[o]);n=!0}},o(r){s=s.filter(Boolean);for(let o=0;o<s.length;o+=1)v(s[o]);n=!1},d(r){r&&y(e),si(s,r)}}}function iI(t,e,n){let i,s,l,r,o,a,c,u,f,d,h,_,p,b,g,w;B(t,eo,$=>n(20,h=$)),B(t,Jl,$=>n(21,_=$)),B(t,vt,$=>n(15,p=$)),B(t,sc,$=>n(16,b=$)),B(t,Je,$=>n(17,g=$)),B(t,me,$=>n(8,w=$));let{locale:k}=e,{keyPath:T=""}=e,{translate:P=!1}=e,{anchor:N}=e;const R=async $=>{if(P&&!d){$e(Jl,_=!0,_),$e(eo,h=[$,k,T,P],h);const C=Jl.subscribe(M=>{M||(C(),window.setTimeout(()=>{N.focus()},250))})}else Mk($,k,T,P)},z=$=>{R($)};return t.$$set=$=>{"locale"in $&&n(0,k=$.locale),"keyPath"in $&&n(1,T=$.keyPath),"translate"in $&&n(2,P=$.translate),"anchor"in $&&n(10,N=$.anchor)},t.$$.update=()=>{t.$$.dirty&131072&&n(14,{collection:i,currentLocales:s,currentValues:l}=g,i,(n(7,s),n(17,g)),(n(6,l),n(17,g))),t.$$.dirty&16384&&n(13,{hasLocales:r=!1,locales:o=["default"]}=i._i18n??{},r,(n(12,o),n(14,i),n(17,g))),t.$$.dirty&12289&&n(5,a=r?o.filter($=>$!==k):[]),t.$$.dirty&65536&&n(11,{serviceId:c,sourceLanguages:u=[],targetLanguages:f=[]}=b??{},c,(n(4,u),n(16,b)),(n(3,f),n(16,b))),t.$$.dirty&34816&&(d=p.apiKeys[c]??"")},[k,T,P,f,u,a,l,s,w,R,N,c,o,r,i,p,b,g,z]}class rc extends ie{constructor(e){super(),ne(this,e,iI,nI,te,{locale:0,keyPath:1,translate:2,anchor:10})}}function sI(t){let e,n,i;function s(r){t[9](r)}let l={readonly:t[2],required:t[3],invalid:t[4],"aria-labelledby":t[1]+"-label","aria-errormessage":t[1]+"-error"};return t[0]!==void 0&&(l.checked=t[0]),e=new uv({props:l}),ae.push(()=>De(e,"checked",s)),{c(){L(e.$$.fragment)},m(r,o){O(e,r,o),i=!0},p(r,[o]){const a={};o&4&&(a.readonly=r[2]),o&8&&(a.required=r[3]),o&16&&(a.invalid=r[4]),o&2&&(a["aria-labelledby"]=r[1]+"-label"),o&2&&(a["aria-errormessage"]=r[1]+"-error"),!n&&o&1&&(n=!0,a.checked=r[0],je(()=>n=!1)),e.$set(a)},i(r){i||(m(e.$$.fragment,r),i=!0)},o(r){v(e.$$.fragment,r),i=!1},d(r){A(e,r)}}}function lI(t,e,n){let{locale:i}=e,{keyPath:s}=e,{fieldId:l}=e,{fieldLabel:r}=e,{fieldConfig:o}=e,{currentValue:a}=e,{readonly:c=!1}=e,{required:u=!1}=e,{invalid:f=!1}=e;function d(h){a=h,n(0,a)}return t.$$set=h=>{"locale"in h&&n(5,i=h.locale),"keyPath"in h&&n(6,s=h.keyPath),"fieldId"in h&&n(1,l=h.fieldId),"fieldLabel"in h&&n(7,r=h.fieldLabel),"fieldConfig"in h&&n(8,o=h.fieldConfig),"currentValue"in h&&n(0,a=h.currentValue),"readonly"in h&&n(2,c=h.readonly),"required"in h&&n(3,u=h.required),"invalid"in h&&n(4,f=h.invalid)},[a,l,c,u,f,i,s,r,o,d]}class rI extends ie{constructor(e){super(),ne(this,e,lI,sI,te,{locale:5,keyPath:6,fieldId:1,fieldLabel:7,fieldConfig:8,currentValue:0,readonly:2,required:3,invalid:4})}}function y_(t){let e,n=t[1](`boolean.${t[0]}`)+"",i;return{c(){e=D("p"),i=K(n)},m(s,l){S(s,e,l),I(e,i)},p(s,l){l&3&&n!==(n=s[1](`boolean.${s[0]}`)+"")&&X(i,n)},d(s){s&&y(e)}}}function oI(t){let e,n=typeof t[0]=="boolean"&&y_(t);return{c(){n&&n.c(),e=x()},m(i,s){n&&n.m(i,s),S(i,e,s)},p(i,[s]){typeof i[0]=="boolean"?n?n.p(i,s):(n=y_(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:q,o:q,d(i){i&&y(e),n&&n.d(i)}}}function aI(t,e,n){let i;B(t,me,a=>n(1,i=a));let{locale:s}=e,{keyPath:l}=e,{fieldConfig:r}=e,{currentValue:o}=e;return t.$$set=a=>{"locale"in a&&n(2,s=a.locale),"keyPath"in a&&n(3,l=a.keyPath),"fieldConfig"in a&&n(4,r=a.fieldConfig),"currentValue"in a&&n(0,o=a.currentValue)},[o,i,s,l,r]}class cI extends ie{constructor(e){super(),ne(this,e,aI,oI,te,{locale:2,keyPath:3,fieldConfig:4,currentValue:0})}}function uI(t){pe(t,"svelte-enlq6k","div.svelte-enlq6k.svelte-enlq6k{display:flex;align-items:center;gap:8px}div.svelte-enlq6k .value.svelte-enlq6k{flex:auto}input.svelte-enlq6k.svelte-enlq6k{font-family:var(--sui-textbox-font-family)}")}function fI(t){let e=(t[0]??"")+"",n;return{c(){n=K(e)},m(i,s){S(i,n,s)},p(i,s){s&1&&e!==(e=(i[0]??"")+"")&&X(n,e)},i:q,o:q,d(i){i&&y(n)}}}function dI(t){let e,n,i;function s(r){t[13](r)}let l={id:t[7]+"-input",invalid:t[4],readonly:t[2],required:t[3],"aria-labelledby":t[1]+"-label","aria-errormessage":t[1]+"-error"};return t[0]!==void 0&&(l.value=t[0]),e=new Zn({props:l}),ae.push(()=>De(e,"value",s)),{c(){L(e.$$.fragment)},m(r,o){O(e,r,o),i=!0},p(r,o){const a={};o&16&&(a.invalid=r[4]),o&4&&(a.readonly=r[2]),o&8&&(a.required=r[3]),o&2&&(a["aria-labelledby"]=r[1]+"-label"),o&2&&(a["aria-errormessage"]=r[1]+"-error"),!n&&o&1&&(n=!0,a.value=r[0],je(()=>n=!1)),e.$set(a)},i(r){i||(m(e.$$.fragment,r),i=!0)},o(r){v(e.$$.fragment,r),i=!1},d(r){A(e,r)}}}function hI(t){let e,n;return e=new Ne({props:{slot:"start-icon",name:"delete"}}),{c(){L(e.$$.fragment)},m(i,s){O(e,i,s),n=!0},p:q,i(i){n||(m(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){A(e,i)}}}function mI(t){let e,n,i,s,l,r,o,a,c,u,f,d,h;const _=[dI,fI],p=[];function b(g,w){return g[5]?0:1}return o=b(t),a=p[o]=_[o](t),u=new Ye({props:{variant:"tertiary",iconic:!0,disabled:!t[0],"aria-label":t[6]("clear"),"aria-controls":`${t[7]}-picker ${t[5]?`${t[7]}-input`:""}`,$$slots:{"start-icon":[hI]},$$scope:{ctx:t}}}),u.$on("click",t[14]),{c(){e=D("div"),n=D("input"),l=F(),r=D("span"),a.c(),c=F(),L(u.$$.fragment),E(n,"id",t[7]+"-picker"),E(n,"type","color"),n.readOnly=t[2],E(n,"aria-invalid",t[4]),E(n,"aria-readonly",t[2]),E(n,"aria-required",t[3]),E(n,"aria-labelledby",i=t[1]+"-label"),E(n,"aria-errormessage",s=t[1]+"-error"),E(n,"class","svelte-enlq6k"),E(r,"role","none"),E(r,"class","value svelte-enlq6k"),E(e,"role","none"),E(e,"class","svelte-enlq6k")},m(g,w){S(g,e,w),I(e,n),Ls(n,t[0]),I(e,l),I(e,r),p[o].m(r,null),I(e,c),O(u,e,null),f=!0,d||(h=We(n,"input",t[12]),d=!0)},p(g,[w]){(!f||w&4)&&(n.readOnly=g[2]),(!f||w&16)&&E(n,"aria-invalid",g[4]),(!f||w&4)&&E(n,"aria-readonly",g[2]),(!f||w&8)&&E(n,"aria-required",g[3]),(!f||w&2&&i!==(i=g[1]+"-label"))&&E(n,"aria-labelledby",i),(!f||w&2&&s!==(s=g[1]+"-error"))&&E(n,"aria-errormessage",s),w&1&&Ls(n,g[0]);let k=o;o=b(g),o===k?p[o].p(g,w):(H(),v(p[k],1,1,()=>{p[k]=null}),V(),a=p[o],a?a.p(g,w):(a=p[o]=_[o](g),a.c()),m(a,1),a.m(r,null));const T={};w&1&&(T.disabled=!g[0]),w&64&&(T["aria-label"]=g[6]("clear")),w&32&&(T["aria-controls"]=`${g[7]}-picker ${g[5]?`${g[7]}-input`:""}`),w&32768&&(T.$$scope={dirty:w,ctx:g}),u.$set(T)},i(g){f||(m(a),m(u.$$.fragment,g),f=!0)},o(g){v(a),v(u.$$.fragment,g),f=!1},d(g){g&&y(e),p[o].d(),A(u),d=!1,h()}}}function pI(t,e,n){let i,s;B(t,me,w=>n(6,s=w));let{locale:l}=e,{keyPath:r}=e,{fieldId:o}=e,{fieldLabel:a}=e,{fieldConfig:c}=e,{currentValue:u}=e,{readonly:f=!1}=e,{required:d=!1}=e,{invalid:h=!1}=e;const _=Kn("color");function p(){u=this.value,n(0,u)}function b(w){u=w,n(0,u)}const g=()=>{n(0,u="")};return t.$$set=w=>{"locale"in w&&n(8,l=w.locale),"keyPath"in w&&n(9,r=w.keyPath),"fieldId"in w&&n(1,o=w.fieldId),"fieldLabel"in w&&n(10,a=w.fieldLabel),"fieldConfig"in w&&n(11,c=w.fieldConfig),"currentValue"in w&&n(0,u=w.currentValue),"readonly"in w&&n(2,f=w.readonly),"required"in w&&n(3,d=w.required),"invalid"in w&&n(4,h=w.invalid)},t.$$.update=()=>{t.$$.dirty&2048&&n(5,{allowInput:i=!1}=c,i)},[u,o,f,d,h,i,s,_,l,r,a,c,p,b,g]}class gI extends ie{constructor(e){super(),ne(this,e,pI,mI,te,{locale:8,keyPath:9,fieldId:1,fieldLabel:10,fieldConfig:11,currentValue:0,readonly:2,required:3,invalid:4},uI)}}function _I(t){pe(t,"svelte-16cruwo",".preview.svelte-16cruwo.svelte-16cruwo{display:inline-flex;align-items:center;gap:8px}.preview.svelte-16cruwo .color.svelte-16cruwo{display:block;width:24px;height:24px;border-radius:24px}")}function S_(t){let e,n,i,s,l,r;return{c(){e=D("p"),n=D("span"),i=D("span"),s=F(),l=D("span"),r=K(t[0]),E(i,"role","none"),E(i,"class","color svelte-16cruwo"),wn(i,"background-color",t[0]),E(l,"role","none"),E(l,"class","value"),E(n,"role","none"),E(n,"class","preview svelte-16cruwo")},m(o,a){S(o,e,a),I(e,n),I(n,i),I(n,s),I(n,l),I(l,r)},p(o,a){a&1&&wn(i,"background-color",o[0]),a&1&&X(r,o[0])},d(o){o&&y(e)}}}function bI(t){let e=typeof t[0]=="string"&&t[0].trim(),n,i=e&&S_(t);return{c(){i&&i.c(),n=x()},m(s,l){i&&i.m(s,l),S(s,n,l)},p(s,[l]){l&1&&(e=typeof s[0]=="string"&&s[0].trim()),e?i?i.p(s,l):(i=S_(s),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},i:q,o:q,d(s){s&&y(n),i&&i.d(s)}}}function vI(t,e,n){let{locale:i}=e,{keyPath:s}=e,{fieldConfig:l}=e,{currentValue:r}=e;return t.$$set=o=>{"locale"in o&&n(1,i=o.locale),"keyPath"in o&&n(2,s=o.keyPath),"fieldConfig"in o&&n(3,l=o.fieldConfig),"currentValue"in o&&n(0,r=o.currentValue)},[r,i,s,l]}class wI extends ie{constructor(e){super(),ne(this,e,vI,bI,te,{locale:1,keyPath:2,fieldConfig:3,currentValue:0},_I)}}//! moment.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/cms",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "publishConfig": {