UNPKG

decap-cms-ui-auth

Version:

UI auth library for Decap CMS

2 lines 32.3 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@emotion/react"),require("react"),require("prop-types"),require("decap-cms-ui-default"),require("decap-cms-lib-auth")):"function"==typeof define&&define.amd?define("DecapCmsUiAuth",["@emotion/react","react","prop-types","decap-cms-ui-default","decap-cms-lib-auth"],t):"object"==typeof exports?exports.DecapCmsUiAuth=t(require("@emotion/react"),require("react"),require("prop-types"),require("decap-cms-ui-default"),require("decap-cms-lib-auth")):e.DecapCmsUiAuth=t(e.DecapCmsDefaultExports.EmotionCore,e.React,e.DecapCmsDefaultExports.PropTypes,e.DecapCmsUiDefault,e.DecapCmsLibAuth)}(window,(e,t,r,n,o)=>(()=>{var i={33:(e,t,r)=>{var n=r(9968),o=r(9756),i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(i,function(r){var n="_."+r[0];t&r[1]&&!o(e,n)&&e.push(n)}),e.sort()}},155:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},528:(e,t,r)=>{var n=r(9747),o=r(5962);function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=n(o.prototype),i.prototype.constructor=i,e.exports=i},547:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},578:(e,t,r)=>{var n=r(3945),o=r(8638),i=r(6850),a=r(8813),s=n(function(e,t){var r=a(t,i(s));return o(e,32,void 0,t,r)});s.placeholder={},e.exports=s},796:(e,t,r)=>{var n=r(7403),o=r(3316)(n);e.exports=o},961:(e,t,r)=>{var n=r(3476),o=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],i=o.call(n,t)?r.length:0;i--;){var a=r[i],s=a.func;if(null==s||s==e)return a.name}return t}},1187:(e,t,r)=>{var n=r(7379),o=r(547);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},1580:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1950:(e,t,r)=>{var n=r(8942)["__core-js_shared__"];e.exports=n},2053:e=>{e.exports=function(e){return e}},2443:(e,t,r)=>{var n=r(6912),o=r(4364),i=r(3504),a=r(4216),s=r(6850),l=r(8813),u=r(8942);e.exports=function(e,t,r){var c=o(e);return function o(){for(var p=arguments.length,d=Array(p),f=p,h=s(o);f--;)d[f]=arguments[f];var g=p<3&&d[0]!==h&&d[p-1]!==h?[]:l(d,h);return(p-=g.length)<r?a(e,t,i,o.placeholder,void 0,d,g,void 0,void 0,r-p):n(this&&this!==u&&this instanceof o?c:e,this,d)}}},2478:(e,t,r)=>{var n=r(7250),o=r(9454),i=r(7706);e.exports=function(e,t,r){return t==t?i(e,t,r):n(e,o,r)}},2532:(e,t,r)=>{var n=r(4715),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},2619:e=>{e.exports=function(e){return function(){return e}}},2945:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},3142:e=>{var t=Array.isArray;e.exports=t},3301:(e,t,r)=>{var n=r(6131),o=1/0;e.exports=function(e){return e?(e=n(e))===o||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},3316:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},3321:(e,t,r)=>{var n=r(7553),o=r(528),i=r(5962),a=r(3142),s=r(547),l=r(3410),u=Object.prototype.hasOwnProperty;function c(e){if(s(e)&&!a(e)&&!(e instanceof n)){if(e instanceof o)return e;if(u.call(e,"__wrapped__"))return l(e)}return new o(e)}c.prototype=i.prototype,c.prototype.constructor=c,e.exports=c},3410:(e,t,r)=>{var n=r(7553),o=r(528),i=r(4354);e.exports=function(e){if(e instanceof n)return e.clone();var t=new o(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},3476:e=>{e.exports={}},3504:(e,t,r)=>{var n=r(4977),o=r(5755),i=r(3816),a=r(4364),s=r(4216),l=r(6850),u=r(6591),c=r(8813),p=r(8942);e.exports=function e(t,r,d,f,h,g,v,y,m,_){var x=128&r,b=1&r,w=2&r,k=24&r,j=512&r,C=w?void 0:a(t);return function O(){for(var P=arguments.length,S=Array(P),A=P;A--;)S[A]=arguments[A];if(k)var I=l(O),E=i(S,I);if(f&&(S=n(S,f,h,k)),g&&(S=o(S,g,v,k)),P-=E,k&&P<_){var T=c(S,I);return s(t,r,e,O.placeholder,d,S,T,y,m,_-P)}var R=b?d:this,L=w?R[t]:t;return P=S.length,y?S=u(S,y):j&&P>1&&S.reverse(),x&&m<P&&(S.length=m),this&&this!==p&&this instanceof O&&(L=C||a(L)),L.apply(R,S)}}},3655:(e,t,r)=>{var n=r(7379),o=r(1580);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3816:e=>{e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},3945:(e,t,r)=>{var n=r(2053),o=r(5234),i=r(796);e.exports=function(e,t){return i(o(e,t,n),e+"")}},4066:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},4119:e=>{"use strict";e.exports=t},4216:(e,t,r)=>{var n=r(6648),o=r(5512),i=r(5620);e.exports=function(e,t,r,a,s,l,u,c,p,d){var f=8&t;t|=f?32:64,4&(t&=~(f?64:32))||(t&=-4);var h=[e,t,s,f?l:void 0,f?u:void 0,f?void 0:l,f?void 0:u,c,p,d],g=r.apply(void 0,h);return n(e)&&o(g,h),g.placeholder=a,i(g,e,t)}},4354:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},4364:(e,t,r)=>{var n=r(9747),o=r(1580);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),i=e.apply(r,t);return o(i)?i:r}}},4715:(e,t,r)=>{var n=r(9624),o=r(155);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},4759:(e,t,r)=>{var n,o=r(1950),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},4943:(e,t,r)=>{var n=r(2053),o=r(6065),i=o?function(e,t){return o.set(e,t),e}:n;e.exports=i},4967:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},4977:e=>{var t=Math.max;e.exports=function(e,r,n,o){for(var i=-1,a=e.length,s=n.length,l=-1,u=r.length,c=t(a-s,0),p=Array(u+c),d=!o;++l<u;)p[l]=r[l];for(;++i<s;)(d||i<a)&&(p[n[i]]=e[i]);for(;c--;)p[l++]=e[i++];return p}},5196:(e,t,r)=>{var n=r(6065),o=r(9071),i=n?function(e){return n.get(e)}:o;e.exports=i},5234:(e,t,r)=>{var n=r(6912),o=Math.max;e.exports=function(e,t,r){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,a=-1,s=o(i.length-t,0),l=Array(s);++a<s;)l[a]=i[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=i[a];return u[t]=r(l),n(e,this,u)}}},5512:(e,t,r)=>{var n=r(4943),o=r(3316)(n);e.exports=o},5620:(e,t,r)=>{var n=r(8788),o=r(9141),i=r(796),a=r(33);e.exports=function(e,t,r){var s=t+"";return i(e,o(s,a(n(s),r)))}},5650:(e,t,r)=>{var n=r(8942).Symbol;e.exports=n},5755:e=>{var t=Math.max;e.exports=function(e,r,n,o){for(var i=-1,a=e.length,s=-1,l=n.length,u=-1,c=r.length,p=t(a-l,0),d=Array(p+c),f=!o;++i<p;)d[i]=e[i];for(var h=i;++u<c;)d[h+u]=r[u];for(;++s<l;)(f||i<a)&&(d[h+n[s]]=e[i++]);return d}},5962:e=>{e.exports=function(){}},6065:(e,t,r)=>{var n=r(9270),o=n&&new n;e.exports=o},6131:(e,t,r)=>{var n=r(6403),o=r(1580),i=r(1187),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||l.test(e)?u(e.slice(2),r?2:8):a.test(e)?NaN:+e}},6171:e=>{"use strict";e.exports=n},6341:(e,t,r)=>{var n=r(6912),o=r(4364),i=r(8942);e.exports=function(e,t,r,a){var s=1&t,l=o(e);return function t(){for(var o=-1,u=arguments.length,c=-1,p=a.length,d=Array(p+u),f=this&&this!==i&&this instanceof t?l:e;++c<p;)d[c]=a[c];for(;u--;)d[c++]=arguments[++o];return n(f,s?r:this,d)}}},6403:(e,t,r)=>{var n=r(2945),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},6591:(e,t,r)=>{var n=r(4354),o=r(9632),i=Math.min;e.exports=function(e,t){for(var r=e.length,a=i(t.length,r),s=n(e);a--;){var l=t[a];e[a]=o(l,r)?s[l]:void 0}return e}},6648:(e,t,r)=>{var n=r(7553),o=r(5196),i=r(961),a=r(3321);e.exports=function(e){var t=i(e),r=a[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=o(r);return!!s&&e===s[0]}},6713:(e,t,r)=>{var n=r(4364),o=r(8942);e.exports=function(e,t,r){var i=1&t,a=n(e);return function t(){return(this&&this!==o&&this instanceof t?a:e).apply(i?r:this,arguments)}}},6850:e=>{e.exports=function(e){return e.placeholder}},6912:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7028:(e,t,r)=>{var n=r(4977),o=r(5755),i=r(8813),a="__lodash_placeholder__",s=Math.min;e.exports=function(e,t){var r=e[1],l=t[1],u=r|l,c=u<131,p=128==l&&8==r||128==l&&256==r&&e[7].length<=t[8]||384==l&&t[7].length<=t[8]&&8==r;if(!c&&!p)return e;1&l&&(e[2]=t[2],u|=1&r?0:4);var d=t[3];if(d){var f=e[3];e[3]=f?n(f,d,t[4]):d,e[4]=f?i(e[3],a):t[4]}return(d=t[5])&&(f=e[5],e[5]=f?o(f,d,t[6]):d,e[6]=f?i(e[5],a):t[6]),(d=t[7])&&(e[7]=d),128&l&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=u,e}},7125:e=>{"use strict";e.exports=o},7250:e=>{e.exports=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},7379:(e,t,r)=>{var n=r(5650),o=r(8870),i=r(9005),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},7403:(e,t,r)=>{var n=r(2619),o=r(2532),i=r(2053),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i;e.exports=a},7434:e=>{"use strict";e.exports=r},7553:(e,t,r)=>{var n=r(9747),o=r(5962);function i(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}i.prototype=n(o.prototype),i.prototype.constructor=i,e.exports=i},7642:(e,t,r)=>{var n=r(3301);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},7706:e=>{e.exports=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}},8110:t=>{"use strict";t.exports=e},8638:(e,t,r)=>{var n=r(4943),o=r(6713),i=r(2443),a=r(3504),s=r(6341),l=r(5196),u=r(7028),c=r(5512),p=r(5620),d=r(7642),f=Math.max;e.exports=function(e,t,r,h,g,v,y,m){var _=2&t;if(!_&&"function"!=typeof e)throw new TypeError("Expected a function");var x=h?h.length:0;if(x||(t&=-97,h=g=void 0),y=void 0===y?y:f(d(y),0),m=void 0===m?m:d(m),x-=g?g.length:0,64&t){var b=h,w=g;h=g=void 0}var k=_?void 0:l(e),j=[e,t,r,h,g,b,w,v,y,m];if(k&&u(j,k),e=j[0],t=j[1],r=j[2],h=j[3],g=j[4],!(m=j[9]=void 0===j[9]?_?0:e.length:f(j[9]-x,0))&&24&t&&(t&=-25),t&&1!=t)C=8==t||16==t?i(e,t,m):32!=t&&33!=t||g.length?a.apply(void 0,j):s(e,t,r,h);else var C=o(e,t,r);return p((k?n:c)(C,j),e,t)}},8788:e=>{var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},8813:e=>{var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,o=e.length,i=0,a=[];++n<o;){var s=e[n];s!==r&&s!==t||(e[n]=t,a[i++]=n)}return a}},8870:(e,t,r)=>{var n=r(5650),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=a.call(e);return n&&(t?e[s]=r:delete e[s]),o}},8942:(e,t,r)=>{var n=r(4967),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},9005:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9071:e=>{e.exports=function(){}},9141:e=>{var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var o=n-1;return r[o]=(n>1?"& ":"")+r[o],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},9270:(e,t,r)=>{var n=r(4715)(r(8942),"WeakMap");e.exports=n},9454:e=>{e.exports=function(e){return e!=e}},9624:(e,t,r)=>{var n=r(3655),o=r(4759),i=r(1580),a=r(4066),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,p=u.hasOwnProperty,d=RegExp("^"+c.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?d:s).test(a(e))}},9632:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},9747:(e,t,r)=>{var n=r(1580),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},9756:(e,t,r)=>{var n=r(2478);e.exports=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1}},9968:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return i[e](r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var l={};return(()=>{"use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.apply(null,arguments)}s.d(l,{DecapCmsUiAuth:()=>K});var t=s(8110),r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var o=/[A-Z]|^ms/g,i=/_EMO_([^_]+?)_([^]*?)_EMO_/g,a=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},c=n(function(e){return a(e)?e:e.replace(o,"-$&").toLowerCase()}),p=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(i,function(e,t,r){return f={name:t,styles:r,next:f},t})}return 1===r[e]||a(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var o=r;if(1===o.anim)return f={name:o.name,styles:o.styles,next:f},o.name;var i=r;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)f={name:a.name,styles:a.styles,next:f},a=a.next;return i.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=d(e,t,r[o])+";";else for(var i in r){var a=r[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":u(s)&&(n+=c(i)+":"+p(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=d(e,t,a);switch(i){case"animation":case"animationName":n+=c(i)+":"+l+";";break;default:n+=i+"{"+l+"}"}}else for(var f=0;f<a.length;f++)u(a[f])&&(n+=c(i)+":"+p(i,a[f])+";")}return n}(e,t,r);case"function":if(void 0!==e){var s=f,l=r(e);return f=s,d(e,t,l)}}var h=r;if(null==t)return h;var g=t[h];return void 0!==g?g:h}var f,h=/label:\s*([^\s;{]+)\s*(;|$)/g,g=s(4119),v=s.n(g),y=!!g.useInsertionEffect&&g.useInsertionEffect,m=y||function(e){return e()};y||g.useLayoutEffect;var _=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},x=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,b=n(function(e){return x.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),w=function(e){return"theme"!==e},k=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?b:w},j=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},C=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return _(t,r,n),m(function(){return function(e,t,r){_(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,r,n)}),null},O=function r(n,o){var i,a,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==o&&(i=o.label,a=o.target);var u=j(n,o,s),c=u||k(l),p=!c("as");return function(){var v=arguments,y=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==i&&y.push("label:"+i+";"),null==v[0]||void 0===v[0].raw)y.push.apply(y,v);else{var m=v[0];y.push(m[0]);for(var _=v.length,x=1;x<_;x++)y.push(v[x],m[x])}var b=(0,t.withEmotionCache)(function(e,r,n){var o,i,s,v,m=p&&e.as||l,_="",x=[],b=e;if(null==e.theme){for(var w in b={},e)b[w]=e[w];b.theme=g.useContext(t.ThemeContext)}"string"==typeof e.className?(o=r.registered,i=x,s=e.className,v="",s.split(" ").forEach(function(e){void 0!==o[e]?i.push(o[e]+";"):e&&(v+=e+" ")}),_=v):null!=e.className&&(_=e.className+" ");var j=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";f=void 0;var i=e[0];null==i||void 0===i.raw?(n=!1,o+=d(r,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=d(r,t,e[a]),n&&(o+=i[a]);h.lastIndex=0;for(var s,l="";null!==(s=h.exec(o));)l+="-"+s[1];var u=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+l;return{name:u,styles:o,next:f}}(y.concat(x),r.registered,b);_+=r.key+"-"+j.name,void 0!==a&&(_+=" "+a);var O=p&&void 0===u?k(m):c,P={};for(var S in e)p&&"as"===S||O(S)&&(P[S]=e[S]);return P.className=_,n&&(P.ref=n),g.createElement(g.Fragment,null,g.createElement(C,{cache:r,serialized:j,isStringTag:"string"==typeof m}),g.createElement(m,P))});return b.displayName=void 0!==i?i:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",b.defaultProps=n.defaultProps,b.__emotion_real=b,b.__emotion_base=l,b.__emotion_styles=y,b.__emotion_forwardProp=u,Object.defineProperty(b,"toString",{value:function(){return"."+a}}),b.withComponent=function(t,n){return r(t,e({},o,n,{shouldForwardProp:j(b,n,!0)})).apply(void 0,y)},b}},P=s(7434),S=s.n(P),A=s(578),I=s.n(A),E=s(6171);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach(function(t){L(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function L(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const D=O("button",{target:"ek030u93",label:"LoginButton"})(E.buttons.button,";",E.shadows.dropDeep,";",E.buttons.default,";",E.buttons.gray,";padding:0 30px;display:block;margin-top:20px;margin-left:auto;"),U=O("form",{target:"ek030u92",label:"AuthForm"})({name:"bjv45a",styles:"width:350px;margin-top:-80px"}),M=O("input",{target:"ek030u91",label:"AuthInput"})("background-color:",E.colorsRaw.white,";border-radius:",E.lengths.borderRadius,";font-size:14px;padding:10px;margin-bottom:15px;margin-top:6px;width:100%;position:relative;z-index:",E.zIndex.zIndex1,";&:focus{outline:none;box-shadow:inset 0 0 0 2px ",E.colors.active,";}"),q=O("p",{target:"ek030u90",label:"ErrorMessage"})("color:",E.colors.errorText,";");let F=null;window.netlifyIdentity&&(window.netlifyIdentity.on("login",e=>{F&&F.handleIdentityLogin(e)}),window.netlifyIdentity.on("logout",()=>{F&&F.handleIdentityLogout()}),window.netlifyIdentity.on("error",e=>{F&&F.handleIdentityError(e)}));class N extends v().Component{constructor(e){super(e),L(this,"handleIdentityLogin",e=>{this.props.onLogin(e),window.netlifyIdentity.close()}),L(this,"handleIdentityLogout",()=>{window.netlifyIdentity.open()}),L(this,"handleIdentityError",e=>{var t;null!=e&&null!==(t=e.message)&&void 0!==t&&t.match(/^Failed to load settings from.+\.netlify\/identity$/)&&(window.netlifyIdentity.close(),this.setState({errors:{identity:this.props.t("auth.errors.identitySettings")}}))}),L(this,"handleIdentity",()=>{const e=window.netlifyIdentity.currentUser();e?this.props.onLogin(e):window.netlifyIdentity.open()}),L(this,"state",{email:"",password:"",errors:{}}),L(this,"handleChange",(e,t)=>{this.setState(R(R({},this.state),{},{[e]:t.target.value}))}),L(this,"handleLogin",async e=>{e.preventDefault();const{email:t,password:r}=this.state,{t:n}=this.props,o={};if(t||(o.email=n("auth.errors.email")),r||(o.password=n("auth.errors.password")),Object.keys(o).length>0)this.setState({errors:o});else try{const e=await N.authClient(),t=await e.login(this.state.email,this.state.password,!0);this.props.onLogin(t)}catch(e){this.setState({errors:{server:e.description||e.msg||e},loggingIn:!1})}}),F=this}componentDidMount(){S().checkPropTypes(N.propTypes,this.props,"prop","GitGatewayAuthenticationPage"),!this.loggedIn&&window.netlifyIdentity&&window.netlifyIdentity.currentUser()&&(this.props.onLogin(window.netlifyIdentity.currentUser()),window.netlifyIdentity.close())}componentWillUnmount(){F=null}render(){const{errors:e}=this.state,{error:r,inProgress:n,config:o,t:i}=this.props;return window.netlifyIdentity?e.identity?(0,t.jsx)(E.AuthenticationPage,{logoUrl:o.logo_url,logo:o.logo,siteUrl:o.site_url,onLogin:this.handleIdentity,renderPageContent:()=>(0,t.jsx)("a",{href:"https://docs.netlify.com/visitor-access/git-gateway/#setup-and-settings",target:"_blank",rel:"noopener noreferrer"},e.identity),t:i}):(0,t.jsx)(E.AuthenticationPage,{logoUrl:o.logo_url,logo:o.logo,siteUrl:o.site_url,onLogin:this.handleIdentity,renderButtonContent:()=>i("auth.loginWithNetlifyIdentity"),t:i}):(0,t.jsx)(E.AuthenticationPage,{logoUrl:o.logo_url,logo:o.logo,siteUrl:o.site_url,renderPageContent:()=>(0,t.jsx)(U,{onSubmit:this.handleLogin},r?(0,t.jsx)(q,null,r):null,e.server?(0,t.jsx)(q,null,String(e.server)):null,(0,t.jsx)(q,null,e.email||null),(0,t.jsx)(M,{type:"text",name:"email",placeholder:"Email",value:this.state.email,onChange:I()(this.handleChange,"email")}),(0,t.jsx)(q,null,e.password||null),(0,t.jsx)(M,{type:"password",name:"password",placeholder:"Password",value:this.state.password,onChange:I()(this.handleChange,"password")}),(0,t.jsx)(D,{disabled:n},i(n?"auth.loggingIn":"auth.login"))),t:i})}}function z(e){this.message=e}L(N,"authClient",void 0),L(N,"propTypes",{onLogin:S().func.isRequired,inProgress:S().bool.isRequired,error:S().node,config:S().object.isRequired,t:S().func.isRequired}),z.prototype=new Error,z.prototype.name="InvalidCharacterError";var $="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new z("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,o=0,i=0,a="";n=t.charAt(i++);~n&&(r=o%4?64*r+n:n,o++%4)?a+=String.fromCharCode(255&r>>(-2*o&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return a};function H(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent($(e).replace(/(.)/g,function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(e){return $(t)}}function W(e){this.message=e}W.prototype=new Error,W.prototype.name="InvalidTokenError";const G=function(e,t){if("string"!=typeof e)throw new W("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(H(e.split(".")[r]))}catch(e){throw new W("Invalid token specified: "+e.message)}};var B=s(7125);function X(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V=O(E.Icon,{target:"ent5iu90",label:"LoginButtonIcon"})({name:"1gnqu05",styles:"margin-right:18px"});class Y extends v().Component{constructor(...e){super(...e),X(this,"state",{}),X(this,"handleLogin",e=>{var t;e.preventDefault();const r=(null===(t=this.props.config.auth)||void 0===t?void 0:t.scope)||this.props.config.auth_scope||"openid email";this.auth.authenticate({scope:r},(e,t)=>{e?this.setState({loginError:e.toString()}):this.props.onLogin(t)})})}componentDidMount(){const{base_url:e="",app_id:t="",auth_endpoint:r="oauth2/authorize",auth_token_endpoint:n="oauth2/token"}=this.props.config.backend,{use_oidc:o=!1,base_url:i=e,auth_endpoint:a=r,auth_token_endpoint:s=n,app_id:l=t,auth_token_endpoint_content_type:u="application/x-www-form-urlencoded; charset=utf-8",email_claim:c="email",full_name_claim:p,first_name_claim:d,last_name_claim:f,avatar_url_claim:h}=this.props.config.auth||{},g=function(e,t,r,n,o){return(i,a)=>{if(a){if(!i.email&&a[e]&&(i.email=a[e]),!i.user_metadata.full_name&&t&&a[t]&&(i.user_metadata.full_name=a[t]),!i.user_metadata.full_name&&(r||n)){const e=[];a[r]&&e.push(a[r]),a[n]&&e.push(a[n]),e.length&&(i.user_metadata.full_name=e.join(" "))}!i.user_metadata.avatar_url&&o&&a[o]&&(i.user_metadata.avatar_url=a[o])}}}(c,p,d,f,h);this.auth=new B.PkceAuthenticator({base_url:i,app_id:l,use_oidc:o,auth_endpoint:a,auth_token_endpoint:s,auth_token_endpoint_content_type:u}),this.auth.completeAuth((e,t)=>{if(e)this.setState({loginError:e.toString()});else{if(t.user_metadata={},t.access_token){t.token=t.access_token;try{t.claims=G(t.access_token),g(t,t.claims)}catch{}}if(t.id_token)try{t.idClaims=G(t.id_token),g(t,t.idClaims)}catch{}this.props.onLogin(t)}})}render(){const{inProgress:e,config:r,t:n}=this.props;return(0,t.jsx)(E.AuthenticationPage,{onLogin:this.handleLogin,loginDisabled:e,loginErrorMessage:this.state.loginError,logoUrl:r.logo_url,logo:r.logo,siteUrl:r.site_url,renderButtonContent:()=>(0,t.jsx)(v().Fragment,null,(0,t.jsx)(V,{type:"link"})," ",n(e?"auth.loggingIn":"auth.login")),t:n})}}X(Y,"propTypes",{inProgress:S().bool,config:S().object.isRequired,onLogin:S().func.isRequired,t:S().func.isRequired});const K={NetlifyAuthenticationPage:N,PKCEAuthenticationPage:Y}})(),l.DecapCmsUiAuth})()); //# sourceMappingURL=decap-cms-ui-auth.js.map