120 lines
6.1 MiB
JavaScript
120 lines
6.1 MiB
JavaScript
|
/*! For license information please see static-cms-app.js.LICENSE.txt */
|
||
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.StaticCmsApp=t():e.StaticCmsApp=t()}(globalThis,(()=>(()=>{var __webpack_modules__={29155:(e,t,n)=>{"use strict";const r=n(99869),i=n.g.Date;class o extends i{constructor(e){super(e),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}`}}e.exports=e=>{const t=new o(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}},71291:(e,t,n)=>{"use strict";const r=n(99869);class i extends Date{constructor(e){super(e+"Z"),this.isFloating=!0}toISOString(){return`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}T${r(2,this.getUTCHours())}:${r(2,this.getUTCMinutes())}:${r(2,this.getUTCSeconds())}.${r(3,this.getUTCMilliseconds())}`}}e.exports=e=>{const t=new i(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}},54991:e=>{"use strict";e.exports=e=>{const t=new Date(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}},86953:(e,t,n)=>{"use strict";const r=n(99869);class i extends Date{constructor(e){super(`0000-01-01T${e}Z`),this.isTime=!0}toISOString(){return`${r(2,this.getUTCHours())}:${r(2,this.getUTCMinutes())}:${r(2,this.getUTCSeconds())}.${r(3,this.getUTCMilliseconds())}`}}e.exports=e=>{const t=new i(e);if(isNaN(t))throw new TypeError("Invalid Datetime");return t}},99869:e=>{"use strict";e.exports=(e,t)=>{for(t=String(t);t.length<e;)t="0"+t;return t}},59299:e=>{"use strict";const t=1114112;class n extends Error{constructor(e,t,r){super("[ParserError] "+e,t,r),this.name="ParserError",this.code="ParserError",Error.captureStackTrace&&Error.captureStackTrace(this,n)}}class r{constructor(e){this.parser=e,this.buf="",this.returned=null,this.result=null,this.resultTable=null,this.resultArr=null}}class i{constructor(){this.pos=0,this.col=0,this.line=0,this.obj={},this.ctx=this.obj,this.stack=[],this._buf="",this.char=null,this.ii=0,this.state=new r(this.parseStart)}parse(e){if(0===e.length||null==e.length)return;let t;for(this._buf=String(e),this.ii=-1,this.char=-1;!1===t||this.nextChar();)t=this.runOne();this._buf=null}nextChar(){return 10===this.char&&(++this.line,this.col=-1),++this.ii,this.char=this._buf.codePointAt(this.ii),++this.pos,++this.col,this.haveBuffer()}haveBuffer(){return this.ii<this._buf.length}runOne(){return this.state.parser.call(this,this.state.returned)}finish(){let e;this.char=t;do{e=this.state.parser,this.runOne()}while(this.state.parser!==e);return this.ctx=null,this.state=null,this._buf=null,this.obj}next(e){if("function"!=typeof e)throw new n("Tried to set state to non-existent state: "+JSON.stringify(e));this.state.parser=e}goto(e){return this.next(e),this.runOne()}call(e,t){t&&this.next(t),this.stack.push(this.state),this.state=new r(e)}callNow(e,t){return this.call(e,t),this.runOne()}return(e){if(0===this.stack.length)throw this.error(new n("Stack underflow"));void 0===e&&(e=this.state.buf),this.state=this.stack.pop(),this.state.returned=e}returnNow(e){return this.return(e),this.runOne()}consume(){if(this.char===t)throw this.error(new n("Unexpected end-of-buffer"));this.state.buf+=this._buf[this.ii]}error(e){return e.line=this.line,e.col=this.col,e.pos=this.pos,e}parseStart(){throw new n("Must declare a parseStart method")}}i.END=t,i.Error=n,e.exports=i},66682:(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=makeParserClass(__webpack_require__(59299)),module.exports.makeParserClass=makeParserClass;class TomlError extends Error{constructor(e){super(e),this.name="TomlError",Error.captureStackTrace&&Error.captureStackTrace(this,TomlError),this.fromTOML=!0,this.wrapped=null}}TomlError.wrap=e=>{const t=new TomlError(e.message);return t.code=e.code,t.wrapped=e,t},module.exports.TomlError=TomlError;const createDateTime=__webpack_require__(54991),createDateTimeFloat=__webpack_require__(71291),createDate=__webpack_require__(29155),createTime=__webpack_require__(86953),CTRL_I=9,CTRL_J=10,CT
|
||
|
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(l,a._`+${i}`);case"integer":return void r.elseIf(a._`${s} === "boolean" || ${i} === null
|
||
|
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,a._`+${i}`);case"boolean":return void r.elseIf(a._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf(a._`${i} === "true" || ${i} === 1`).assign(l,!0);case"null":return r.elseIf(a._`${i} === "" || ${i} === 0 || ${i} === false`),void r.assign(l,null);case"array":r.elseIf(a._`${s} === "string" || ${s} === "number"
|
||
|
|| ${s} === "boolean" || ${i} === null`).assign(l,a._`[${i}]`)}}r.else(),p(e),r.endIf(),r.if(a._`${l} !== undefined`,(()=>{r.assign(i,l),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(a._`${t} !== undefined`,(()=>e.assign(a._`${t}[${n}]`,r)))}(e,l)}))}(e,t,s):p(e)}))}return c};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=l.Correct){const i=r===l.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._`${t} ${i} null`;case"array":o=a._`Array.isArray(${t})`;break;case"object":o=a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=s(a._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=s();break;default:return a._`typeof ${t} ${i} ${e}`}return r===l.Correct?o:(0,a.not)(o);function s(e=a.nil){return(0,a.and)(a._`typeof ${t} == "number"`,e,n?a._`isFinite(${t})`:a.nil)}}function f(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let i;const o=(0,s.toHash)(e);if(o.array&&o.object){const e=a._`typeof ${t} != "object"`;i=o.null?e:a._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=a.nil;o.number&&delete o.integer;for(const e in o)i=(0,a.and)(i,d(e,t,n,r));return i}t.checkDataType=d,t.checkDataTypes=f;const h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._`{type: ${e}}`:a._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:n,schema:r}=e,i=(0,s.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,h)}t.reportTypeError=p},15944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(56110),i=n(20530);function o(e,t,n){const{gen:o,compositeRule:a,data:s,opts:l}=e;if(void 0===n)return;const c=r._`${s}${(0,r.getProperty)(t)}`;if(a)return void(0,i.checkStrictMode)(e,`default is ignored for: ${c}`);let u=r._`${c} === undefined`;"empty"===l.useDefaults&&(u=r._`${u} || ${c} === null || ${c} === ""`),o.if(u,r._`${c} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)o(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>o(e,n,t.default)))}},43750:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(42971),i=n(97349),o=n(87177),a=n(97349),s=n(15944),l=n(42e3),c=n(35678),u=n(56110),d=n(17748),f=n(66184),h=n(20530),p=n(16257);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},o){i.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,i)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,i),e.code(o)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(i)}`,r.$async,(()=>e.code(g(n,i)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function O({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function y(e){(0,h.checkUnknownRul
|
||
|
missingProperty: ${i},
|
||
|
depsCount: ${t},
|
||
|
deps: ${n}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);s(e,t),l(e,n)}};function s(e,t=e.schema){const{gen:n,data:i,it:a}=e;if(0===Object.keys(t).length)return;const s=n.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const u=(0,o.propertyInData)(n,i,l,a.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),a.allErrors?n.if(u,(()=>{for(const t of c)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,o.checkMissingProp)(e,c,s)})`),(0,o.reportMissingProp)(e,s),n.else())}}function l(e,t=e.schema){const{gen:n,data:r,keyword:a,it:s}=e,l=n.name("valid");for(const c in t)(0,i.alwaysValidSchema)(s,t[c])||(n.if((0,o.propertyInData)(n,r,c,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:c},l);e.mergeValidEvaluated(t,l)}),(()=>n.var(l,!0))),e.ok(l))}t.validatePropertyDeps=s,t.validateSchemaDeps=l,t.default=a},17498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(56110),i=n(20530),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const s=a(o,"then"),l=a(o,"else");if(!s&&!l)return;const c=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),s&&l){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else s?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,i){return()=>{const o=e.subschema({keyword:n},u);t.assign(c,u),e.mergeValidEvaluated(o,c),i?t.assign(i,r._`${n}`):e.setParams({ifClause:n})}}e.pass(c,(()=>e.error(!0)))}};function a(e,t){const n=e.schema[t];return void 0!==n&&!(0,i.alwaysValidSchema)(e,n)}t.default=o},3698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(81600),i=n(53609),o=n(38223),a=n(62490),s=n(97458),l=n(32790),c=n(13796),u=n(88183),d=n(11935),f=n(98289),h=n(62514),p=n(50120),m=n(16328),g=n(68302),O=n(17498),v=n(96105);t.default=function(e=!1){const t=[h.default,p.default,m.default,g.default,O.default,v.default,c.default,u.default,l.default,d.default,f.default];return e?t.push(i.default,a.default):t.push(r.default,o.default),t.push(s.default),t}},38223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(56110),i=n(20530),o=n(57111),a={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return s(e,"additionalItems",t);n.items=!0,(0,i.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function s(e,t,n=e.schema){const{gen:o,parentSchema:a,data:s,keyword:l,it:c}=e;!function(e){const{opts:r,errSchemaPath:o}=c,a=n.length,s=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(r.strictTuples&&!s){const e=`"${l}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(c,e,r.strictTuples)}}(a),c.opts.unevaluated&&n.length&&!0!==c.items&&(c.items=i.mergeEvaluated.items(o,n.length,c.items));const u=o.name("valid"),d=o.const("len",r._`${s}.length`);n.forEach(((t,n)=>{(0,i.alwaysValidSchema)(c,t)||(o.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:l,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=s,t.default=a},62490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(56110),i=n(20530),o=n(57111),a=n(81600),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schem
|
||
|
[StaticCMS] Multiple widgets registered with name "${t}". Only the last widget registered with
|
||
|
this name will be used.
|
||
|
`),!n)throw Error(`Widget "${t}" registered without \`controlComponent\`.`);Wg.widgets[t]={control:n,preview:r,validator:i,converters:o,getValidValue:a,getDefaultValue:s,schema:l}}else console.error("`registerWidget` failed, called with incorrect arguments.")}function Hg(e){return Wg.widgets[e]}function Kg(){return Object.entries(Wg.widgets).map((([e,t])=>Mg({name:e},t)))}function Jg(e){return Hg(e||"string")||Hg("unknown")}function eO(e){return Wg.widgetValueSerializers[e]}function tO(e,t){e&&t?Wg.backends[e]?console.error(`Backend [${e}] already registered. Please choose a different name.`):Wg.backends[e]={init:(e,n)=>new t(e,n)}:console.error("Backend parameters invalid. example: CMS.registerBackend('myBackend', BackendClass)")}function nO(e){return Wg.backends[e]}function rO(e){if(!Xg.includes(e))throw new Error(`Invalid event name '${e}'`)}function iO(e){const{name:t,collection:n,file:r,field:i}=e;rO(t);const o=[];var a,s,l,c,u,d,f,h,p,m,g;return"change"===t?(o.push(...Wg.eventHandlers[t].all),n?(o.push(...null!==(a=Wg.eventHandlers[t].collections[n])&&void 0!==a?a:[]),r||i?(i&&o.push(...null!==(f=null===(h=Wg.eventHandlers[t].collectionField[n])||void 0===h?void 0:h[i])&&void 0!==f?f:[]),r?(o.push(...null!==(s=null===(l=Wg.eventHandlers[t].files[n])||void 0===l?void 0:l[r])&&void 0!==s?s:[]),i?(o.push(...null!==(c=null===(u=Wg.eventHandlers[t].fileField[n])||void 0===u||null===(d=u[r])||void 0===d?void 0:d[i])&&void 0!==c?c:[]),o):o):o):o):o):"prePublish"===t||"postPublish"===t||"preSave"===t||"postSave"===t?(o.push(...Wg.eventHandlers[t].all),n?(o.push(...null!==(p=Wg.eventHandlers[t].collections[n])&&void 0!==p?p:[]),r?(o.push(...null!==(m=null===(g=Wg.eventHandlers[t].files[n])||void 0===g?void 0:g[r])&&void 0!==m?m:[]),o):o):o):[...Wg.eventHandlers[t]]}async function oO(e){const{name:t,data:n,collection:r,file:i,fieldName:o,field:a}=e;if(rO(t),"mounted"===t||"logout"===t){console.info(`[StaticCMS] Firing ${t} event`);const e=Wg.eventHandlers[t];for(const t of e)t();return}if("login"===t){console.info("[StaticCMS] Firing login event",n);const e=Wg.eventHandlers[t];for(const t of e)t({author:n});return}if("postSave"===t||"prePublish"===t||"postPublish"===t){if(!r)return;const e=iO({name:t,collection:r,file:i});console.info(`[StaticCMS] Firing post save event for${i?` "${i}" file in`:""} "${r}" collection`,n);for(const t of e)t({data:n,collection:r,file:i});return}if("change"===t){if(!r||!a||!n)return;const s=iO({name:t,collection:r,file:i,field:a});let l=Ng()(n);console.info(`[StaticCMS] Firing change event for field "${null!=o?o:a}" for${e.file?` "${e.file}" file in`:""} "${r}" collection`);for(const e of s){const t=await e({data:l,collection:r,file:i,field:a});void 0!==l&&t&&(l=t)}return l}if(!r)return;let s=Ng()(n);console.info(`[StaticCMS] Firing pre save event for${e.file?` "${e.file}" file in`:""} "${r}" collection`,n);const l=iO({name:t,collection:r,file:i});for(const e of l){const t=await e({data:s,collection:r,file:i});if(void 0!==s&&void 0!==t){const e=Mg(Mg({},s.entry),{},{data:t});s=Mg(Mg({},s),{},{entry:e})}}return s.entry.data}function aO(e,t){return e.filter((e=>e!==t))}function sO(e,t){e&&t?Wg.locales[e]=t:console.error("Locale parameters invalid. example: CMS.registerLocale('locale', phrases)")}function lO(e){return Wg.locales[e]}function cO(e){var t;return null!==(t=Wg.icons[e])&&void 0!==t?t:null}function uO(){return Wg.additionalLinks}function dO(e){return Wg.shortcodes[e]}function fO(){return Wg.shortcodes}function hO(){return Wg.themes}function pO(e,t){const n="backup";return e?`${n}.${e}${t?`.${t}`:""}`:n}const mO={PRESENCE:"PRESENCE",PATTERN:"PATTERN",RANGE:"RANGE",CUSTOM:"CUSTOM"};function gO(e,t,n,r,i){var o;if("string"==typeof n||"number"==typeof n)return!1;const a=null!==(o=null==n?void 0:n.length)&&void 0!==o?o:0;function s(n){return{type:mO.RANGE,message:e(`editor.editorControlPane.widget.${n}`,{fieldLabel:t,minCount:r,maxCount:i,count:a})}}return[r,i].every((e=>e&&!isNaN(e)))&&(a<r||a>i)?s(r===i?"rangeCountExact":"rangeCount"):r&&!isNaN(r)&&r>0&&a<r?s("rangeMin"):!!(i&&!isNaN
|
||
|
source.repository.full_name = "${this.repo}"
|
||
|
AND state = "${nG.OPEN}"
|
||
|
AND destination.branch.name = "${this.branch}"
|
||
|
AND comment_count > 0
|
||
|
AND ${t}
|
||
|
`}}),r=await Promise.all(n.values.map((e=>this.getPullRequestLabel(e.id))));return n.values.filter(((e,t)=>Gh(r[t],this.cmsLabelPrefix)))}async getBranchPullRequest(e){const t=await this.getPullRequests(e);if(t.length<=0)throw new dp("content is not under editorial workflow",!0);return t[0]}async retrieveUnpublishedEntryData(e){const{collection:t,slug:n}=Yh(e),r=ep(e),i=await this.getBranchPullRequest(r),o=await this.getDifferences(r),a=Hh(await this.getPullRequestLabel(i.id),this.cmsLabelPrefix),s=i.updated_on,l=i.author.display_name;return{collection:t,slug:n,status:a,diffs:o.filter((e=>"deleted"!==e.status)).map((e=>({path:e.path,newFile:e.newFile,id:""}))),updatedAt:s,pullRequestAuthor:l,openAuthoring:!1}}async addPullRequestComment(e,t){await this.requestJSON({method:"POST",url:`${this.repoURL}/pullrequests/${e.id}/comments`,headers:{"Content-Type":oG},body:JSON.stringify({content:{raw:t}})})}async updateUnpublishedEntryStatus(e,t,n){const r=ep(Vh(e,t)),i=await this.getBranchPullRequest(r);await this.addPullRequestComment(i,Kh(n,this.cmsLabelPrefix))}async declinePullRequest(e){await this.requestJSON({method:"POST",url:`${this.repoURL}/pullrequests/${e.id}/decline`})}async deleteBranch(e){await this.request({method:"DELETE",url:`${this.repoURL}/refs/branches/${e}`})}async deleteUnpublishedEntry(e,t){const n=ep(Vh(e,t)),r=await this.getBranchPullRequest(n);await this.declinePullRequest(r),await this.deleteBranch(n)}async mergePullRequest(e){await this.requestJSON({method:"POST",url:`${this.repoURL}/pullrequests/${e.id}/merge`,headers:{"Content-Type":oG},body:JSON.stringify({message:Bh,close_source_branch:!0,merge_strategy:this.mergeStrategy})})}async publishUnpublishedEntry(e,t){const n=ep(Vh(e,t)),r=await this.getBranchPullRequest(n);await this.mergePullRequest(r)}async getPullRequestStatuses(e){return(await this.requestJSON({url:`${this.repoURL}/pullrequests/${e.id}/statuses`,params:{pagelen:"100"}})).values}async getStatuses(e,t){const n=ep(Vh(e,t)),r=await this.getBranchPullRequest(n);return(await this.getPullRequestStatuses(r)).map((({key:e,state:t,url:n})=>({context:e,state:t===rG.Successful?JZ.Success:JZ.Other,target_url:n})))}async createPullRequest(e,t,n){const r=await this.requestJSON({method:"POST",url:`${this.repoURL}/pullrequests`,headers:{"Content-Type":oG},body:JSON.stringify({title:t,source:{branch:{name:e}},destination:{branch:{name:this.branch}},description:qh,close_source_branch:!0})});await this.addPullRequestComment(r,Kh(n,this.cmsLabelPrefix))}async editorialWorkflowGit(e,t,n){const r=ep(Vh(n.collectionName,t));if(n.unpublished){const t=await this.getDifferences(r),i=[];for(const n of t.filter((e=>e.binary&&"deleted"!==e.status)))e.some((e=>e.path===n.path))||i.push({path:n.path,delete:!0});await this.uploadFiles([...e,...i],{commitMessage:n.commitMessage,branch:r})}else{const t=await this.branchCommitSha(this.branch);await this.uploadFiles(e,{commitMessage:n.commitMessage,branch:r,parentSha:t}),await this.createPullRequest(r,n.commitMessage,n.status||this.initialWorkflowStatus)}}async getUnpublishedEntrySha(e,t){const n=ep(Vh(e,t));return(await this.getBranchPullRequest(n)).destination.commit.hash}}var lG=c.forwardRef((function(e,t){return c.createElement(d$,Tv({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 512 512"},e,{ref:t}),c.createElement("path",{fill:"currentColor",d:"M22.2 32A16 16 0 0 0 6 47.8a26.35 26.35 0 0 0 .2 2.8l67.9 412.1a21.77 21.77 0 0 0 21.3 18.2h325.7a16 16 0 0 0 16-13.4L505 50.7a16 16 0 0 0-13.2-18.3 24.58 24.58 0 0 0-2.8-.2L22.2 32zm285.9 297.8h-104l-28.1-147h157.3l-25.2 147z"}))}));lG.displayName="Bitbucket";const cG=({href:e})=>{const t=pS();return c.createElement(xS,{variant:"text",href:e,startIcon:RL},t("ui.default.goBackToSite"))},uG=gS("Login",["root","custom-logo","static-cms-logo","error","error-icon","error-sr-label","button"]),dG=({inProgress:e=!1,login:t,icon:n,label:r,error:i,disabled:o=!1,buttonContent:a})=>{const s=pS(),l=qE(LO);return c.createElement("div",{className:uG.root},null!=l&&l
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a Bitbucket account with access.
|
||
|
`,e})))throw new Error("Your BitBucket user account does not have access to this repo.");const t=await this.api.user();return uH(uH({},t),{},{name:t.display_name,login:t.username,token:e.token,avatar_url:t.links.avatar.href,refresh_token:e.refresh_token})}getRefreshedAccessToken(){var e;if("implicit"===this.authType)throw new tp("Can't refresh access token when using implicit auth");if(this.refreshedTokenPromise)return this.refreshedTokenPromise;if(!this.authenticator){const e={base_url:this.baseUrl,site_id:this.siteId};this.authenticator=new CE(e)}return this.refreshedTokenPromise=null===(e=this.authenticator.refresh({provider:"bitbucket",refresh_token:this.refreshToken}))||void 0===e?void 0:e.then((({token:e,refresh_token:t})=>(this.token=e,this.refreshToken=t,this.refreshedTokenPromise=void 0,this.updateUserCredentials({token:e,refresh_token:t}),e))),this.refreshedTokenPromise}logout(){this.token=null}getToken(){return this.refreshedTokenPromise?this.refreshedTokenPromise:Promise.resolve(this.token)}async entriesByFolder(e,t,n){let r;const i=await this.api.defaultBranchCommitSha(),o=await lm((()=>this.api.listFiles(e,n,20,this.branch).then((({entries:e,cursor:n})=>(r=n.mergeMeta({extension:t}),e.filter((e=>gp(e,t))))))),((e,t)=>this.api.readFile(e,t,{head:i})),this.api.readFileMetadata.bind(this.api),iG);return o[lp]=r,o}async listAllFiles(e,t,n){const r=(await this.api.listAllFiles(e,n,this.branch)).filter((e=>gp(e,t)));return r}async allEntriesByFolder(e,t,n){const r=await this.api.defaultBranchCommitSha(),i=await vm({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:(e,t)=>this.api.readFile(e,t,{head:r}),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:iG,branch:this.branch,localForage:km,folder:e,extension:t,depth:n,getDefaultBranch:()=>Promise.resolve({name:this.branch,sha:r}),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>Promise.resolve(this.api.getFileId(r,e)),filterFile:e=>gp(e,t)});return i}async entriesByFiles(e){const t=await this.api.defaultBranchCommitSha();return cm(e,((e,n)=>this.api.readFile(e,n,{head:t})),this.api.readFileMetadata.bind(this.api),iG)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listAllFiles(e,1,this.branch,t).then((e=>e.map((({id:e,name:t,path:n,type:r})=>({id:e,name:t,path:n,displayURL:{id:e,path:n},isDirectory:"commit_directory"===r}))))):[]}getLargeMediaClient(){return this._largeMediaClientPromise||(this._largeMediaClientPromise=(async()=>{const e=await this.api.readFile(".gitattributes").then((e=>Xp(e))).catch((e=>(404===e.status?console.info("[StaticCMS] This 404 was expected and handled appropriately."):console.error(e),[])));return new lH(!!(this.largeMediaURL&&e.length>0),this.largeMediaURL,e,this.requestFunction)})()),this._largeMediaClientPromise}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||dh()(10),hm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=em(e),n=dm(t,await fm(e,null,this.api.readFile.bind(this.api))),r=URL.createObjectURL(n);return{id:await Sp(n),displayURL:r,path:e,name:t,size:n.size,file:n,url:r}}async persistEntry(e,t){const n=await this.getLargeMediaClient();return pm(this.lock,(async()=>this.api.persistFiles(e.dataFiles,n.enabled?await Bp(n,e.assets):e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const{fileObj:n,path:r}=e,i=URL.createObjectURL(n),o=await this.getLargeMediaClient(),a=r.startsWith("/")?r.slice(1):r;if(!o.enabled||!o.matchPath(a))return this._persistMedia(e,t);const s=await qp(o,n,r);return uH(uH({},await this._persistMedia(s,t)),{},{displayURL:i})}async _persistMedia(e,t){const n=e.fileObj,[r]=await Promise.all([Sp(n),this.api.persistFiles([],[e],t)]),i=URL.createObjectURL(n);return{displayURL:i,path:r_()(e.path,"/k"),name:n.name,size:n.size,id:r,file:n,url:i}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}traverseCursor(e,t){return this
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a GitHub account with access.
|
||
|
|
||
|
If your repo is under an organization, ensure the organization has granted access to Netlify
|
||
|
CMS.
|
||
|
`,e})))throw new Error("Your GitHub user account does not have access to this repo.");return CK(CK({},n),{},{token:e.token,useOpenAuthoring:this.useOpenAuthoring})}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await lm((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>gp(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),wK);return o[lp]=i,o}async allEntriesByFolder(e,t,n,r){const i=this.api.originRepoURL,o=await lm((()=>this.api.listFiles(e,{repoURL:i,depth:n}).then((e=>e.filter((e=>(!r||r.test(e.path))&&gp(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:i})),this.api.readFileMetadata.bind(this.api),wK);return o}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return cm(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),wK)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listFiles(e,void 0,t).then((e=>e.map((({id:e,name:t,size:n,path:r,type:i})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r,isDirectory:"tree"==i}))))):[]}async getMediaFile(e){const t=await fm(e,null,this.api.readFile.bind(this.api)),n=em(e),r=dm(n,t),i=URL.createObjectURL(r);return{id:await Sp(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||dh()(10),hm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return pm(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:r_()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){var n,r;const i=e.meta,o=null!==(n=null===(r=e.data)||void 0===r?void 0:r.files)&&void 0!==n?n:[];let a;switch(t){case"first":default:a=this.getCursorAndFiles(o,1);break;case"last":var s;a=this.getCursorAndFiles(o,null!==(s=null==i?void 0:i.pageCount)&&void 0!==s?s:1);break;case"next":var l;a=this.getCursorAndFiles(o,null!==(l=(null==i?void 0:i.page)+1)&&void 0!==l?l:1);break;case"prev":var c;a=this.getCursorAndFiles(o,null!==(c=(null==i?void 0:i.page)-1)&&void 0!==c?c:1)}return{entries:await cm(a.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),wK),cursor:a.cursor}}async unpublishedEntries(){return await um((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>Jh(e)))))))}async unpublishedEntry({id:e,collection:t,slug:n}){if(e)return this.api.retrieveUnpublishedEntryData(e);if(t&&n){const e=this.api.generateContentKey(t,n);return this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){return ep(this.api.generateContentKey(e,t))}async unpublishedEntryDataFile(e,t,n,r){const i=this.getBranch(e,t);return await this.api.readFile(n,r,{branch:i})}async unpublishedEntryMediaFile(e,t,n,r){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:n,id:r})}async getDeployPreview(e,t){try{const n=Fh(await this.api.getStatuses(e,t),this.previewContext);if(n){const{target_url:e,state:t}=n;return{url:e,status:t}}return null}catch(e){return null}}updateUnpublishedEntryStatus(e,t,n){return pm(this.lock,(()=>this.api.updateUnpublishedEntryStatus(e,t,n)),"Failed to acquire update entry status lock")}deleteUnpublishedEntry(e,t){return pm(this.lock,(()=>this.api.deleteUnpublishedEntry(e,t)),"Failed
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a GitLab account with access.
|
||
|
`,e})))throw new Error("Your GitLab user account does not have access to this repo.");return VK(VK({},t),{},{login:t.username,token:e.token})}async logout(){this.token=null}getToken(){return Promise.resolve(this.token)}filterFile(e,t,n,r){const i=mo()(t.path.split(e)[1]||"/","/");return gp(t,n)&&i.split("/").length<=r}async entriesByFolder(e,t,n){let r;const i=await lm((()=>this.api.listFiles(e,n>1).then((({files:i,cursor:o})=>(r=o.mergeMeta({folder:e,extension:t,depth:n}),i.filter((r=>this.filterFile(e,r,t,n))))))),this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),NK);return i[lp]=r,i}async listAllFiles(e,t,n){const r=(await this.api.listAllFiles(e,void 0,n>1)).filter((r=>this.filterFile(e,r,t,n)));return r}async allEntriesByFolder(e,t,n){const r=await vm({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:this.api.readFile.bind(this.api),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:NK,branch:this.branch,localForage:km,folder:e,extension:t,depth:n,getDefaultBranch:()=>this.api.getDefaultBranch().then((e=>({name:e.name,sha:e.commit.id}))),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>this.api.getFileId(e,this.branch),filterFile:r=>this.filterFile(e,r,t,n),customFetch:void 0});return r}entriesByFiles(e){return cm(e,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),NK)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listAllFiles(e,t).then((e=>e.map((({id:e,name:t,path:n,type:r})=>({id:e,name:t,path:n,displayURL:{id:e,name:t,path:n},isDirectory:"tree"===r}))))):[]}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||dh()(10),hm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=em(e),n=await fm(e,null,this.api.readFile.bind(this.api)),r=dm(t,n),i=URL.createObjectURL(r);return{id:await Sp(n),displayURL:i,path:e,name:t,size:r.size,file:r,url:i}}async persistEntry(e,t){return pm(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const n=e.fileObj,[r]=await Promise.all([Sp(n),this.api.persistFiles([],[e],t)]),{path:i}=e,o=URL.createObjectURL(n);return{displayURL:o,path:r_()(i,"/"),name:n.name,size:n.size,file:n,url:o,id:r}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}traverseCursor(e,t){return this.api.traverseCursor(e,t).then((async({entries:t,cursor:n})=>{var r,i,o;const[a,s,l]=[null===(r=e.meta)||void 0===r?void 0:r.folder,null===(i=e.meta)||void 0===i?void 0:i.depth,null===(o=e.meta)||void 0===o?void 0:o.extension];return a&&s&&l&&(t=t.filter((e=>this.filterFile(a,e,l,s))),n=n.mergeMeta({folder:a,extension:l,depth:s})),{entries:await cm(t,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),NK),cursor:n}}))}async unpublishedEntries(){return await um((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>Jh(e)))))))}async unpublishedEntry({id:e,collection:t,slug:n}){if(e)return this.api.retrieveUnpublishedEntryData(e);if(t&&n){const e=Vh(t,n);return this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){return ep(Vh(e,t))}async unpublishedEntryDataFile(e,t,n,r){const i=this.getBranch(e,t);return await this.api.readFile(n,r,{branch:i})}async unpublishedEntryMediaFile(e,t,n,r){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:n,id:r})}async updateUnpublishedEntryStatus(e,t,n){return pm(this.lock,(()=>this.api.updateUnpublishedEntryStatus(e,t,n)),"Failed to acquire update entry status lock")}async deleteUnpublishedEntry(e,t){return pm(this.lock,(()=>this.api.deleteUnpublishedEntry(e,t)),"Failed to acquire delete entry lock")}async publishUnpublishedEntry(e,t){return pm(this.lock,(()=>this.api.publishUnpublishedEntry(e,t)),"Failed to acquire publish entry lock")}async getDeployPreview(e,t){try{const n=Fh(await this.api.getStatu
|
||
|
Repo "${this.repo}" not found.
|
||
|
|
||
|
Please ensure the repo information is spelled correctly.
|
||
|
|
||
|
If the repo is private, make sure you're logged into a Gitea account with access.
|
||
|
|
||
|
If your repo is under an organization, ensure the organization has granted access to Static
|
||
|
CMS.
|
||
|
`,e})))throw new Error("Your Gitea user account does not have access to this repo.");return{name:n.full_name,login:n.login,avatar_url:n.avatar_url,token:e.token}}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await lm((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>gp(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),$J);return o[lp]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL,i=await lm((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>e.filter((e=>gp(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),$J);return i}entriesByFiles(e){const t=this.api.repoURL;return cm(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),$J)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listFiles(e,void 0,t).then((e=>e.map((({id:e,name:t,size:n,path:r,type:i})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r,isDirectory:"tree"===i}))))):[]}async getMediaFile(e){const t=await fm(e,null,this.api.readFile.bind(this.api)),n=em(e),r=dm(n,t),i=URL.createObjectURL(r);return{id:await Sp(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||dh()(10),hm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return pm(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:r_()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){var n,r;const i=e.meta,o=null!==(n=null===(r=e.data)||void 0===r?void 0:r.files)&&void 0!==n?n:[];let a;switch(t){case"first":default:a=this.getCursorAndFiles(o,1);break;case"last":var s;a=this.getCursorAndFiles(o,null!==(s=null==i?void 0:i.pageCount)&&void 0!==s?s:1);break;case"next":var l;a=this.getCursorAndFiles(o,null!==(l=(null==i?void 0:i.page)+1)&&void 0!==l?l:1);break;case"prev":var c;a=this.getCursorAndFiles(o,null!==(c=(null==i?void 0:i.page)-1)&&void 0!==c?c:1)}return{entries:await cm(a.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),$J),cursor:a.cursor}}async unpublishedEntries(){throw new Error("Editorial workflow is not yet available for Gitea")}async unpublishedEntry(){throw new Error("Editorial workflow is not yet available for Gitea")}async unpublishedEntryDataFile(){throw new Error("Editorial workflow is not yet available for Gitea")}async unpublishedEntryMediaFile(){throw new Error("Editorial workflow is not yet available for Gitea")}async updateUnpublishedEntryStatus(){throw new Error("Editorial workflow is not yet available for Gitea")}async publishUnpublishedEntry(){throw new Error("Editorial workflow is not yet available for Gitea")}async deleteUnpublishedEntry(){throw new Error("Editorial workflow is not yet available for Gitea")}async getDeployPreview(){throw new Error("Editorial workflow is not yet available for Gitea")}}const NJ=({inProgress:e=!1,onLogin:t})=>{const n=(0,c.useCallback)((e=>{e.preventDefault(),t({token:"fake_token"})}),[t]);return c.createElement(dG,{login:n,inProgress:e})};function UJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}retur
|
||
|
0% {
|
||
|
transform: scale(0);
|
||
|
opacity: 0.1;
|
||
|
}
|
||
|
|
||
|
100% {
|
||
|
transform: scale(1);
|
||
|
opacity: 0.3;
|
||
|
}
|
||
|
`)),Fpe=Ape(zpe||(zpe=Upe`
|
||
|
0% {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
|
||
|
100% {
|
||
|
opacity: 0;
|
||
|
}
|
||
|
`)),Xpe=Ape(Lpe||(Lpe=Upe`
|
||
|
0% {
|
||
|
transform: scale(1);
|
||
|
}
|
||
|
|
||
|
50% {
|
||
|
transform: scale(0.92);
|
||
|
}
|
||
|
|
||
|
100% {
|
||
|
transform: scale(1);
|
||
|
}
|
||
|
`)),Wpe=uD("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),qpe=uD((function(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:u}=e,[d,f]=c.useState(!1),h=QS(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-a/2+o,left:-a/2+i},m=QS(n.child,d&&n.childLeaving,r&&n.childPulsate);return s||d||f(!0),c.useEffect((()=>{if(!s&&null!=l){const e=setTimeout(l,u);return()=>{clearTimeout(e)}}}),[l,s,u]),(0,zS.jsx)("span",{className:h,style:p,children:(0,zS.jsx)("span",{className:m})})}),{name:"MuiTouchRipple",slot:"Ripple"})(Npe||(Npe=Upe`
|
||
|
opacity: 0;
|
||
|
position: absolute;
|
||
|
|
||
|
&.${0} {
|
||
|
opacity: 0.3;
|
||
|
transform: scale(1);
|
||
|
animation-name: ${0};
|
||
|
animation-duration: ${0}ms;
|
||
|
animation-timing-function: ${0};
|
||
|
}
|
||
|
|
||
|
&.${0} {
|
||
|
animation-duration: ${0}ms;
|
||
|
}
|
||
|
|
||
|
& .${0} {
|
||
|
opacity: 1;
|
||
|
display: block;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
border-radius: 50%;
|
||
|
background-color: currentColor;
|
||
|
}
|
||
|
|
||
|
& .${0} {
|
||
|
opacity: 0;
|
||
|
animation-name: ${0};
|
||
|
animation-duration: ${0}ms;
|
||
|
animation-timing-function: ${0};
|
||
|
}
|
||
|
|
||
|
& .${0} {
|
||
|
position: absolute;
|
||
|
/* @noflip */
|
||
|
left: 0px;
|
||
|
top: 0;
|
||
|
animation-name: ${0};
|
||
|
animation-duration: 2500ms;
|
||
|
animation-timing-function: ${0};
|
||
|
animation-iteration-count: infinite;
|
||
|
animation-delay: 200ms;
|
||
|
}
|
||
|
`),Dpe.rippleVisible,Mpe,550,(({theme:e})=>e.transitions.easing.easeInOut),Dpe.ripplePulsate,(({theme:e})=>e.transitions.duration.shorter),Dpe.child,Dpe.childLeaving,Fpe,550,(({theme:e})=>e.transitions.easing.easeInOut),Dpe.childPulsate,Xpe,(({theme:e})=>e.transitions.easing.easeInOut)),Bpe=c.forwardRef((function(e,t){const n=gD({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:o}=n,a=b$(n,jpe),[s,l]=c.useState([]),u=c.useRef(0),d=c.useRef(null);c.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[s]);const f=c.useRef(!1),h=c.useRef(0),p=c.useRef(null),m=c.useRef(null);c.useEffect((()=>()=>{h.current&&clearTimeout(h.current)}),[]);const g=c.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;l((e=>[...e,(0,zS.jsx)(qpe,{classes:{ripple:QS(i.ripple,Dpe.ripple),rippleVisible:QS(i.rippleVisible,Dpe.rippleVisible),ripplePulsate:QS(i.ripplePulsate,Dpe.ripplePulsate),child:QS(i.child,Dpe.child),childLeaving:QS(i.childLeaving,Dpe.childLeaving),childPulsate:QS(i.childPulsate,Dpe.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},u.current)])),u.current+=1,d.current=a}),[i]),O=c.useCallback(((e={},t={},n=(()=>{}))=>{const{pulsate:i=!1,center:o=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&f.current)return void(f.current=!1);"touchstart"===(null==e?void 0:e.type)&&(f.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,d;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(o)d=Math.sqrt((2*l.width**2+l.height**2)/3),d%2==0&&(d+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;d=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===p.current&&(p.current=()=>{g({pulsate:i,rippleX:c,rippleY:u,rippleSize:d,cb:n})},h.current=setTimeout((()=>{p.current&&(p.current(),p.current=null)}),80)):g({pulsate:i,rippleX:c,rippleY:u,rippleSize:d,cb:n})}),[r,g]),v=c.useCallback((()=>{O({},{pulsate:!0})}),[O]),y=c.useCallback(((e,t)=>{if(clearTimeout(h.current),"touchend"===(null==e?void 0:e.type)&&p.current)return p.current(),p.current=null,void(h.current=setTimeout((()=>{y(e,t)})));p.current=null,l((e=>e.length>0?e.slice(1):e)),d.current=t}),[]);return c.useImperativeHandle(t,(()=>({pulsate:v,start:O,stop:y})),[v,O,y]),(0,zS.jsx)(Wpe,w$({className:QS(Dpe.root,i.root,o),ref:m},a,{children:(0,zS.jsx)($pe,{component:null,exit:!0,children:s})}))})),Vpe=Bpe;function Ype(e){return cP("MuiButtonBase",e)}const Zpe=uP("MuiButtonBase",["root","disabled","focusVisible"]),Gpe=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Hpe=uD("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Zpe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Kpe=c.forwardRef((function(e,t){const n=gD({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:o,className:a,component:s="button",disabled:l=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:h="a",onBlur:p,onClick:m,onContextMenu:g,onDragLeave:O,onFocus:v,onFocusVisible:y
|