diff --git a/README.md b/README.md index 045229f..8aa2618 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Barrierearme, dreistufige Portalnavigation auf Basis von SharePoint Managed Meta | Eigenschaft | Wert | |---|---| -| Version | 1.1.0 | +| Version | 1.1.1 | | SharePoint Framework | SPFx 1.4.1 | | Node.js | 8.17.0 | | Zieloberfläche | Moderne SharePoint-Seiten | @@ -130,8 +130,10 @@ sharepoint/solution/mega-menu.sppkg 1. `mega-menu.sppkg` in den App Catalog laden. 2. Die Solution freigeben. -3. Die App in der gewünschten Site Collection installieren. -4. Das MegaMenu site-scoped registrieren. +3. Die App im Root Web der gewünschten Site Collection installieren. Der MegaMenu Application Customizer wird dabei automatisch web-scoped registriert und von PortalSettings erkannt. +4. Das Termset in PortalSettings konfigurieren. + +Das folgende Skript ist nur erforderlich, wenn ausdrücklich eine site-scoped Registrierung oder eine vollständig skriptbasierte Vorkonfiguration gewünscht ist. Empfohlen mit Termset-GUID: @@ -263,6 +265,11 @@ MegaMenu/ ## Versionshistorie +### 1.1.1 + +- automatische Registrierung des MegaMenu Application Customizers bei der App-Installation +- direkte Erkennung durch PortalSettings ohne vorherigen Skriptaufruf + ### 1.1.0 - konsistente Verwendung des Default Site Collection Term Store diff --git a/config/package-solution.json b/config/package-solution.json index 97ad251..981a871 100644 --- a/config/package-solution.json +++ b/config/package-solution.json @@ -3,9 +3,22 @@ "solution": { "name": "mega-menu-client-side-solution", "id": "f4660e06-ce08-43ee-bfb7-5c4464e01133", - "version": "1.1.0.0", + "version": "1.1.1.0", "includeClientSideAssets": true, - "skipFeatureDeployment": false + "skipFeatureDeployment": false, + "features": [ + { + "title": "MegaMenu extension registration", + "description": "Registers the MegaMenu Application Customizer in the host web.", + "id": "1e4fdc74-8053-48b2-a15b-e975d61eb71f", + "version": "1.1.1.0", + "assets": { + "elementManifests": [ + "elements.xml" + ] + } + } + ] }, "paths": { "zippedPackage": "solution/mega-menu.sppkg" diff --git a/dist/abc3361f-bb2d-491f-aba3-cd51c19a299b.manifest.json b/dist/abc3361f-bb2d-491f-aba3-cd51c19a299b.manifest.json index aef8f8c..0e8b733 100644 --- a/dist/abc3361f-bb2d-491f-aba3-cd51c19a299b.manifest.json +++ b/dist/abc3361f-bb2d-491f-aba3-cd51c19a299b.manifest.json @@ -3,7 +3,7 @@ "alias": "MegaMenuApplicationCustomizer", "componentType": "Extension", "extensionType": "ApplicationCustomizer", - "version": "1.1.0", + "version": "1.1.1", "manifestVersion": 2, "requiresCustomScript": false, "loaderConfig": { diff --git a/dist/mega-menu-application-customizer.js b/dist/mega-menu-application-customizer.js index f3d0cc7..a496b76 100644 --- a/dist/mega-menu-application-customizer.js +++ b/dist/mega-menu-application-customizer.js @@ -1,4 +1,4 @@ -define("abc3361f-bb2d-491f-aba3-cd51c19a299b_1.1.0",["@microsoft/decorators","@microsoft/sp-application-base","MegaMenuApplicationCustomizerStrings","@microsoft/sp-http","@microsoft/sp-lodash-subset"],function(e,t,n,r,o){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";function r(e,t,n){for(var r=[],o=3;o=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function i(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function a(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,i=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]-1?e.substr(0,t):e}function u(e){var t=[],n=["odata.type","odata.editLink","__metadata","odata.metadata"];return Object(y.j)(e,n[0])&&"SP.Web"===e[n[0]]?Object(y.j)(e,n[1])?t.push(e[n[1]]):Object(y.j)(e,n[2])&&t.push(e.__metadata.uri):Object(y.j)(e,n[3])&&Object(y.j)(e,n[1])?t.push(s(e[n[3]]),"_api",e[n[1]]):Object(y.j)(e,n[1])?t.push("_api",e[n[1]]):Object(y.j)(e,n[2])&&t.push(e.__metadata.uri),t.length<1?(b.a.write("No uri information found in ODataEntity parsing, chaining will fail for this object.",2),""):y.d.apply(void 0,t)}function c(e){return new O(e)}function l(e){y.c.extend(e)}function p(e){return new Promise(function(t){if(Object(y.m)(e))return t(e);if(null!==C.baseUrl)return t(Object(y.d)(C.baseUrl,e));if(void 0!==N._spPageContextInfo){if(Object(y.j)(N._spPageContextInfo,"webAbsoluteUrl"))return t(Object(y.d)(N._spPageContextInfo.webAbsoluteUrl,e));if(Object(y.j)(N._spPageContextInfo,"webServerRelativeUrl"))return t(Object(y.d)(N._spPageContextInfo.webServerRelativeUrl,e))}if(void 0!==N.location){var n=N.location.toString().toLowerCase();["/_layouts/","/siteassets/"].forEach(function(r){var o=n.indexOf(r);if(o>0)return t(Object(y.d)(n.substr(0,o),e))})}return t(e)})}function d(e){return{__metadata:{type:e}}}function h(e){return function(t){return function(t){function n(){for(var n=[],r=0;r1&&void 0!==n[1]?n[1]:e)||this}return r(n,t),n}(t)}}function f(e){return e.length<1?1:Math.max.apply(null,e.map(function(e){return e.order}))+1}function g(e){for(var t=0;tt.lastIndexOf("(")){var o=t.lastIndexOf("/");r._parentUrl=t.slice(0,o),n=Object(y.d)(t.slice(o),n),r._url=Object(y.d)(r._parentUrl,n)}else{var o=t.lastIndexOf("(");r._parentUrl=t.slice(0,o),r._url=Object(y.d)(t,n)}else{r.extend(t,n);var i=t.query.get("@target");void 0!==i&&r.query.set("@target",i)}return r}return r(t,e),t.prototype.as=function(e){var t=new e(this._url,null);return Object(y.f)(t,this,!0)},t.prototype.toUrlAndQuery=function(){var e=new Map(this.query),t=this.toUrl().replace(/'!(@.*?)::(.*?)'/gi,function(t,n,r){return b.a.write("Rewriting aliased parameter from match "+t+" to label: "+n+" value: "+r,0),e.set(n,"'"+r+"'"),n});if(e.size>0){t+=""+(t.indexOf("?")>-1?"&":"?")+Array.from(e).map(function(e){return e[0]+"="+e[1]}).join("&")}return t},t.prototype.select=function(){for(var e=[],t=0;t0&&this.query.set("$select",e.join(",")),this},t.prototype.expand=function(){for(var e=[],t=0;t0&&this.query.set("$expand",e.join(",")),this},t.prototype.getParent=function(e,t,n,r){void 0===t&&(t=this.parentUrl);var o=new e(t,n).configureFrom(this),i="@target";return this.query.has(i)&&o.query.set(i,this.query.get(i)),void 0!==r&&(o=o.inBatch(r)),o},t.prototype.clone=function(t,n,r){void 0===r&&(r=!0);var o=e.prototype._clone.call(this,new t(this,n),{includeBatch:r}),i="@target";return this.query.has(i)&&o.query.set(i,this.query.get(i)),o},t.prototype.toRequestContext=function(e,t,n,r){var o=this;void 0===t&&(t={});var i=this.hasBatch?this._batchDependency:function(){};return p(this.toUrlAndQuery()).then(function(a){return Object(y.p)(t,o._options),{batch:o.batch,batchDependency:i,cachingOptions:o._cachingOptions,clientFactory:function(){return new E},isBatched:o.hasBatch,isCached:o._forceCaching||o._useCaching&&/^get$/i.test(e),options:t,parser:n,pipeline:r,requestAbsoluteUrl:a,requestId:Object(y.h)(),verb:e}})},t}(v.h),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.filter=function(e){return this.query.set("$filter",e),this},t.prototype.orderBy=function(e,t){void 0===t&&(t=!0);var n="$orderby",r=this.query.has(n)?this.query.get(n).split(","):[];return r.push(e+" "+(t?"asc":"desc")),this.query.set(n,r.join(",")),this},t.prototype.skip=function(e){return this.query.set("$skip",e.toString()),this},t.prototype.top=function(e){return this.query.set("$top",e.toString()),this},t}(x),R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype._update=function(e,t){var n=this;return function(r){return n.postCore({body:Object(y.n)(Object(y.f)(d(e),r)),headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return t(e,r)})}},t.prototype._delete=function(){return this.postCore({headers:{"X-HTTP-Method":"DELETE"}})},t.prototype._deleteWithETag=function(e){return void 0===e&&(e="*"),this.postCore({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t}(x),A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){return new k(this,"getById("+e+")")},t.prototype.getByEmail=function(e){return new k(this,"getByEmail('"+e+"')")},t.prototype.getByLoginName=function(e){var t=new k(this);return t.concat("('!@v::"+encodeURIComponent(e)+"')"),t},t.prototype.removeById=function(e){return this.clone(n,"removeById("+e+")").postCore()},t.prototype.removeByLoginName=function(e){var t=this.clone(n,"removeByLoginName(@v)");return t.query.set("@v","'"+encodeURIComponent(e)+"'"),t.postCore()},t.prototype.add=function(e){var t=this;return this.clone(n,null).postCore({body:Object(y.n)(Object(y.f)(d("SP.User"),{LoginName:e}))}).then(function(){return t.getByLoginName(e)})};var n;return t=n=o([h("siteusers")],t)}(j),U=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"groups",{get:function(){return new M(this,"groups")},enumerable:!0,configurable:!0}),t}(R),k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.update=t._update("SP.User",function(e){return{data:e,user:t}}),t.delete=t._delete,t}return r(t,e),t}(U),L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("currentuser")],t)}(U);!function(e){e[e.None=0]="None",e[e.User=1]="User",e[e.DistributionList=2]="DistributionList",e[e.SecurityGroup=4]="SecurityGroup",e[e.SharePointGroup=8]="SharePointGroup",e[e.All=15]="All"}(m||(m={}));var D,M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){var t=new F(this);return t.concat("("+e+")"),t},t.prototype.add=function(e){var t=this,n=Object(y.n)(Object(y.f)(d("SP.Group"),e));return this.postCore({body:n}).then(function(e){return{data:e,group:t.getById(e.Id)}})},t.prototype.getByName=function(e){return new F(this,"getByName('"+e+"')")},t.prototype.removeById=function(e){return this.clone(n,"removeById('"+e+"')").postCore()},t.prototype.removeByLoginName=function(e){return this.clone(n,"removeByLoginName('"+e+"')").postCore()};var n;return t=n=o([h("sitegroups")],t)}(j),F=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.update=n._update("SP.Group",function(e,r){var o=n;return Object(y.j)(r,"Title")&&(o=n.getParent(t,n.parentUrl,"getByName('"+r.Title+"')")),{data:e,group:o}}),n}return r(t,e),Object.defineProperty(t.prototype,"users",{get:function(){return new A(this,"users")},enumerable:!0,configurable:!0}),t.prototype.setUserAsOwner=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){return[2,this.clone(t,"SetUserAsOwner("+e+")").postCore()]})})},t}(R),B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){var t=new G(this);return t.concat("("+e+")"),t},t.prototype.add=function(e,t){return this.clone(n,"addroleassignment(principalid="+e+", roledefid="+t+")").postCore()},t.prototype.remove=function(e,t){return this.clone(n,"removeroleassignment(principalid="+e+", roledefid="+t+")").postCore()};var n;return t=n=o([h("roleassignments")],t)}(j),G=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._delete,t}return r(t,e),Object.defineProperty(t.prototype,"groups",{get:function(){return new M(this,"groups")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindings",{get:function(){return new W(this)},enumerable:!0,configurable:!0}),t}(R),q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){return new H(this,"getById("+e+")")},t.prototype.getByName=function(e){return new H(this,"getbyname('"+e+"')")},t.prototype.getByType=function(e){return new H(this,"getbytype("+e+")")},t.prototype.add=function(e,t,n,r){var o=this,i=Object(y.n)({BasePermissions:{High:r.High.toString(),Low:r.Low.toString()},Description:t,Name:e,Order:n,__metadata:{type:"SP.RoleDefinition"}});return this.postCore({body:i}).then(function(e){return{data:e,definition:o.getById(e.Id)}})},t=o([h("roledefinitions")],t)}(j),H=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._delete,t}return r(t,e),t.prototype.update=function(e){var t=this;void 0!==Object(y.j)(e,"BasePermissions")&&(e.BasePermissions=Object(y.f)({__metadata:{type:"SP.BasePermissions"}},{High:e.BasePermissions.High.toString(),Low:e.BasePermissions.Low.toString()}));var n=Object(y.n)(Object(y.f)(d("SP.RoleDefinition"),e));return this.postCore({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(n){var r=t;if(Object(y.j)(e,"Name")){r=t.getParent(q,t.parentUrl,"").getByName(e.Name)}return{data:n,definition:r}})},t}(R),W=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("roledefinitionbindings")],t)}(j);!function(e){e[e.Display=1]="Display",e[e.Edit=2]="Edit",e[e.New=3]="New"}(D||(D={}));var K;!function(e){e[e.Invalid=0]="Invalid",e[e.Integer=1]="Integer",e[e.Text=2]="Text",e[e.Note=3]="Note",e[e.DateTime=4]="DateTime",e[e.Counter=5]="Counter",e[e.Choice=6]="Choice",e[e.Lookup=7]="Lookup",e[e.Boolean=8]="Boolean",e[e.Number=9]="Number",e[e.Currency=10]="Currency",e[e.URL=11]="URL",e[e.Computed=12]="Computed",e[e.Threading=13]="Threading",e[e.Guid=14]="Guid",e[e.MultiChoice=15]="MultiChoice",e[e.GridChoice=16]="GridChoice",e[e.Calculated=17]="Calculated",e[e.File=18]="File",e[e.Attachments=19]="Attachments",e[e.User=20]="User",e[e.Recurrence=21]="Recurrence",e[e.CrossProjectLink=22]="CrossProjectLink",e[e.ModStat=23]="ModStat",e[e.Error=24]="Error",e[e.ContentTypeId=25]="ContentTypeId",e[e.PageSeparator=26]="PageSeparator",e[e.ThreadIndex=27]="ThreadIndex",e[e.WorkflowStatus=28]="WorkflowStatus",e[e.AllDayEvent=29]="AllDayEvent",e[e.WorkflowEventType=30]="WorkflowEventType"}(K||(K={}));var V;!function(e){e[e.DateOnly=0]="DateOnly",e[e.DateTime=1]="DateTime"}(V||(V={}));var Q;!function(e){e[e.Unspecified=0]="Unspecified",e[e.Disabled=1]="Disabled",e[e.Relative=2]="Relative"}(Q||(Q={}));var z;!function(e){e[e.DefaultValue=0]="DefaultValue",e[e.AddToDefaultContentType=1]="AddToDefaultContentType",e[e.AddToNoContentType=2]="AddToNoContentType",e[e.AddToAllContentTypes=4]="AddToAllContentTypes",e[e.AddFieldInternalNameHint=8]="AddFieldInternalNameHint",e[e.AddFieldToDefaultView=16]="AddFieldToDefaultView",e[e.AddFieldCheckDisplayName=32]="AddFieldCheckDisplayName"}(z||(z={}));var J;!function(e){e[e.Gregorian=1]="Gregorian",e[e.Japan=3]="Japan",e[e.Taiwan=4]="Taiwan",e[e.Korea=5]="Korea",e[e.Hijri=6]="Hijri",e[e.Thai=7]="Thai",e[e.Hebrew=8]="Hebrew",e[e.GregorianMEFrench=9]="GregorianMEFrench",e[e.GregorianArabic=10]="GregorianArabic",e[e.GregorianXLITEnglish=11]="GregorianXLITEnglish",e[e.GregorianXLITFrench=12]="GregorianXLITFrench",e[e.KoreaJapanLunar=14]="KoreaJapanLunar",e[e.ChineseLunar=15]="ChineseLunar",e[e.SakaEra=16]="SakaEra",e[e.UmAlQura=23]="UmAlQura"}(J||(J={}));var X;!function(e){e[e.Hyperlink=0]="Hyperlink",e[e.Image=1]="Image"}(X||(X={}));var Y;!function(e){e[e.EmptyMask=0]="EmptyMask",e[e.ViewListItems=1]="ViewListItems",e[e.AddListItems=2]="AddListItems",e[e.EditListItems=3]="EditListItems",e[e.DeleteListItems=4]="DeleteListItems",e[e.ApproveItems=5]="ApproveItems",e[e.OpenItems=6]="OpenItems",e[e.ViewVersions=7]="ViewVersions",e[e.DeleteVersions=8]="DeleteVersions",e[e.CancelCheckout=9]="CancelCheckout",e[e.ManagePersonalViews=10]="ManagePersonalViews",e[e.ManageLists=12]="ManageLists",e[e.ViewFormPages=13]="ViewFormPages",e[e.AnonymousSearchAccessList=14]="AnonymousSearchAccessList",e[e.Open=17]="Open",e[e.ViewPages=18]="ViewPages",e[e.AddAndCustomizePages=19]="AddAndCustomizePages",e[e.ApplyThemeAndBorder=20]="ApplyThemeAndBorder",e[e.ApplyStyleSheets=21]="ApplyStyleSheets",e[e.ViewUsageData=22]="ViewUsageData",e[e.CreateSSCSite=23]="CreateSSCSite",e[e.ManageSubwebs=24]="ManageSubwebs",e[e.CreateGroups=25]="CreateGroups",e[e.ManagePermissions=26]="ManagePermissions",e[e.BrowseDirectories=27]="BrowseDirectories",e[e.BrowseUserInfo=28]="BrowseUserInfo",e[e.AddDelPrivateWebParts=29]="AddDelPrivateWebParts",e[e.UpdatePersonalWebParts=30]="UpdatePersonalWebParts",e[e.ManageWeb=31]="ManageWeb",e[e.AnonymousSearchAccessWebLists=32]="AnonymousSearchAccessWebLists",e[e.UseClientIntegration=37]="UseClientIntegration",e[e.UseRemoteAPIs=38]="UseRemoteAPIs",e[e.ManageAlerts=39]="ManageAlerts",e[e.CreateAlerts=40]="CreateAlerts",e[e.EditMyUserInfo=41]="EditMyUserInfo",e[e.EnumeratePermissions=63]="EnumeratePermissions",e[e.FullMask=65]="FullMask"}(Y||(Y={}));var $;!function(e){e[e.None=0]="None",e[e.User=1]="User",e[e.DistributionList=2]="DistributionList",e[e.SecurityGroup=4]="SecurityGroup",e[e.SharePointGroup=8]="SharePointGroup",e[e.All=15]="All"}($||($={}));var Z;!function(e){e[e.None=0]="None",e[e.UserInfoList=1]="UserInfoList",e[e.Windows=2]="Windows",e[e.MembershipProvider=4]="MembershipProvider",e[e.RoleProvider=8]="RoleProvider",e[e.All=15]="All"}(Z||(Z={}));var ee;!function(e){e[e.None=0]="None",e[e.Guest=1]="Guest",e[e.Reader=2]="Reader",e[e.Contributor=3]="Contributor",e[e.WebDesigner=4]="WebDesigner",e[e.Administrator=5]="Administrator"}(ee||(ee={}));var te;!function(e){e[e.Invalid=-1]="Invalid",e[e.DefaultView=0]="DefaultView",e[e.NormalView=1]="NormalView",e[e.DialogView=2]="DialogView",e[e.View=3]="View",e[e.DisplayForm=4]="DisplayForm",e[e.DisplayFormDialog=5]="DisplayFormDialog",e[e.EditForm=6]="EditForm",e[e.EditFormDialog=7]="EditFormDialog",e[e.NewForm=8]="NewForm",e[e.NewFormDialog=9]="NewFormDialog",e[e.SolutionForm=10]="SolutionForm",e[e.PAGE_MAXITEMS=11]="PAGE_MAXITEMS"}(te||(te={}));var ne;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Direct=1]="Direct",e[e.OrganizationView=2]="OrganizationView",e[e.OrganizationEdit=3]="OrganizationEdit",e[e.AnonymousView=4]="AnonymousView",e[e.AnonymousEdit=5]="AnonymousEdit",e[e.Flexible=6]="Flexible"}(ne||(ne={}));var re;!function(e){e[e.None=0]="None",e[e.View=1]="View",e[e.Edit=2]="Edit",e[e.Owner=3]="Owner"}(re||(re={}));var oe;!function(e){e[e.CompletedSuccessfully=0]="CompletedSuccessfully",e[e.AccessRequestsQueued=1]="AccessRequestsQueued",e[e.NoResolvedUsers=-1]="NoResolvedUsers",e[e.AccessDenied=-2]="AccessDenied",e[e.CrossSiteRequestNotSupported=-3]="CrossSiteRequestNotSupported",e[e.UnknowError=-4]="UnknowError",e[e.EmailBodyTooLong=-5]="EmailBodyTooLong",e[e.ListUniqueScopesExceeded=-6]="ListUniqueScopesExceeded",e[e.CapabilityDisabled=-7]="CapabilityDisabled",e[e.ObjectNotSupported=-8]="ObjectNotSupported",e[e.NestedGroupsNotSupported=-9]="NestedGroupsNotSupported"}(oe||(oe={}));var ie;!function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Folder=2]="Folder",e[e.Item=3]="Item",e[e.List=4]="List",e[e.Web=5]="Web",e[e.Max=6]="Max"}(ie||(ie={}));var ae;!function(e){e[e.None=0]="None",e[e.AllowList=1]="AllowList",e[e.BlockList=2]="BlockList"}(ae||(ae={}));var se;!function(e){e[e.None=0]="None",e[e.ContextInfo=1]="ContextInfo",e[e.ListData=2]="ListData",e[e.ListSchema=4]="ListSchema",e[e.MenuView=8]="MenuView",e[e.ListContentType=16]="ListContentType",e[e.FileSystemItemId=32]="FileSystemItemId",e[e.ClientFormSchema=64]="ClientFormSchema",e[e.QuickLaunch=128]="QuickLaunch",e[e.Spotlight=256]="Spotlight",e[e.Visualization=512]="Visualization",e[e.ViewMetadata=1024]="ViewMetadata",e[e.DisableAutoHyperlink=2048]="DisableAutoHyperlink",e[e.EnableMediaTAUrls=4096]="EnableMediaTAUrls",e[e.ParentInfo=8192]="ParentInfo",e[e.PageContextInfo=16384]="PageContextInfo",e[e.ClientSideComponentManifest=32768]="ClientSideComponentManifest"}(se||(se={}));var ue;!function(e){e[e.PeopleAndGroups=1]="PeopleAndGroups",e[e.PeopleOnly=0]="PeopleOnly"}(ue||(ue={}));var ce;!function(e){e[e.Dropdown=0]="Dropdown",e[e.RadioButtons=1]="RadioButtons"}(ce||(ce={}));var le;!function(e){e[e.DefaultZone=0]="DefaultZone",e[e.Intranet=1]="Intranet",e[e.Internet=2]="Internet",e[e.Custom=3]="Custom",e[e.Extranet=4]="Extranet"}(le||(le={}));var pe,de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"roleAssignments",{get:function(){return new B(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstUniqueAncestorSecurableObject",{get:function(){return new R(this,"FirstUniqueAncestorSecurableObject")},enumerable:!0,configurable:!0}),t.prototype.getUserEffectivePermissions=function(e){var t=this.clone(x,"getUserEffectivePermissions(@user)");return t.query.set("@user","'"+encodeURIComponent(e)+"'"),t.get().then(function(e){return Object(y.j)(e,"GetUserEffectivePermissions")?e.GetUserEffectivePermissions:e})},t.prototype.getCurrentUserEffectivePermissions=function(){return this.clone(x,"EffectiveBasePermissions").get().then(function(e){return Object(y.j)(e,"EffectiveBasePermissions")?e.EffectiveBasePermissions:e})},t.prototype.breakRoleInheritance=function(e,n){return void 0===e&&(e=!1),void 0===n&&(n=!1),this.clone(t,"breakroleinheritance(copyroleassignments="+e+", clearsubscopes="+n+")").postCore()},t.prototype.resetRoleInheritance=function(){return this.clone(t,"resetroleinheritance").postCore()},t.prototype.userHasPermissions=function(e,t){var n=this;return this.getUserEffectivePermissions(e).then(function(e){return n.hasPermissions(e,t)})},t.prototype.currentUserHasPermissions=function(e){var t=this;return this.getCurrentUserEffectivePermissions().then(function(n){return t.hasPermissions(n,e)})},t.prototype.hasPermissions=function(e,t){if(!t)return!0;if(t===Y.FullMask)return 32767==(32767&e.High)&&65535===e.Low;t-=1;var n=1;return t>=0&&t<32?(n<<=t,0!=(e.Low&n)):t>=32&&t<64&&(n<<=t-32,0!=(e.High&n))},t}(R),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getShareLink=function(e,n){void 0===n&&(n=null);var r=null!==n?n.toISOString():null;return this.clone(t,"shareLink").postCore({body:Object(y.n)({request:{createLink:!0,emailData:null,settings:{expiration:r,linkKind:e}}})})},t.prototype.shareWith=function(e,n,r,o,i){var a=this;void 0===r&&(r=!1),void 0===o&&(o=!1),Array.isArray(e)||(e=[e]);var s=Object(y.n)(e.map(function(e){return{Key:e}})),u=n===re.Edit?ee.Contributor:ee.Reader;return new j("_api/web","roledefinitions").select("Id").filter("RoleTypeKind eq "+u).get().then(function(e){if(!Array.isArray(e)||e.length<1)throw Error("Could not locate a role defintion with RoleTypeKind "+u);var n={includeAnonymousLinkInEmail:r,peoplePickerInput:s,propagateAcl:o,roleValue:"role:"+e[0].Id,useSimplifiedRoles:!0};return void 0!==i&&(n=Object(y.f)(n,{emailBody:i.body,emailSubject:void 0!==i.subject?i.subject:"",sendEmail:!0})),a.clone(t,"shareObject").postCore({body:Object(y.n)(n)})})},t.prototype.shareObject=function(e,t){var n=this;return void 0===t&&(t=!1),t?this.sendShareObjectRequest(e):(e=Object(y.f)(e,{group:null,includeAnonymousLinkInEmail:!1,propagateAcl:!1,useSimplifiedRoles:!0},!0),this.getRoleValue(e.role,e.group).then(function(t){Array.isArray(e.loginNames)||(e.loginNames=[e.loginNames]);var r=Object(y.n)(e.loginNames.map(function(e){return{Key:e}})),o={peoplePickerInput:r,roleValue:t,url:e.url};return void 0!==e.emailData&&null!==e.emailData&&(o=Object(y.f)(o,{emailBody:e.emailData.body,emailSubject:void 0!==e.emailData.subject?e.emailData.subject:"Shared with you.",sendEmail:!0})),n.sendShareObjectRequest(o)}))},t.prototype.unshareObjectWeb=function(e){return this.clone(t,"unshareObject").postCore({body:Object(y.n)({url:e})})},t.prototype.checkPermissions=function(e){return this.clone(t,"checkPermissions").postCore({body:Object(y.n)({recipients:e})})},t.prototype.getSharingInformation=function(e,n){void 0===e&&(e=null);var r=this.clone(t,"getSharingInformation");return r.expand.apply(r,n).postCore({body:Object(y.n)({request:e})})},t.prototype.getObjectSharingSettings=function(e){return void 0===e&&(e=!0),this.clone(t,"getObjectSharingSettings").postCore({body:Object(y.n)({useSimplifiedRoles:e})})},t.prototype.unshareObject=function(){return this.clone(t,"unshareObject").postCore()},t.prototype.deleteLinkByKind=function(e){return this.clone(t,"deleteLinkByKind").postCore({body:Object(y.n)({linkKind:e})})},t.prototype.unshareLink=function(e,n){return void 0===n&&(n="00000000-0000-0000-0000-000000000000"),this.clone(t,"unshareLink").postCore({body:Object(y.n)({linkKind:e,shareId:n})})},t.prototype.getRoleValue=function(e,t){if(void 0===t||null===t){var n=e===re.Edit?ee.Contributor:ee.Reader;return new j("_api/web","roledefinitions").select("Id").top(1).filter("RoleTypeKind eq "+n).get().then(function(e){if(e.length<1)throw Error("Could not locate associated role definition for supplied role. Edit and View are supported");return"role: "+e[0].Id})}switch(t){case ee.Contributor:return new R("_api/web","associatedmembergroup").select("Id").get().then(function(e){return"group: "+e.Id});case ee.Reader:case ee.Guest:return new R("_api/web","associatedvisitorgroup").select("Id").get().then(function(e){return"group: "+e.Id});default:throw Error("Could not determine role value for supplied value. Contributor, Reader, and Guest are supported")}},t.prototype.getShareObjectWeb=function(e){return Promise.resolve(new R(s(e),"/_api/SP.Web.ShareObject"))},t.prototype.sendShareObjectRequest=function(e){return this.getShareObjectWeb(this.toUrl()).then(function(n){return n.expand("UsersWithAccessRequests","GroupsSharedWith").as(t).postCore({body:Object(y.n)(e)})})},t}(x),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shareWith=function(e,t,n){var r=this;void 0===t&&(t=re.View);var o=this.addBatchDependency();return new R(s(this.toUrl()),"/_api/web/url").get().then(function(i){return o(),r.shareObject(Object(y.d)(i,"/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1"),e,t,n)})},t.prototype.shareObject=function(e,t,n,r,o,i,a,s){return void 0===i&&(i=!1),void 0===a&&(a=!1),void 0===s&&(s=!0),this.clone(he,null).shareObject({emailData:r,group:o,includeAnonymousLinkInEmail:a,loginNames:t,propagateAcl:i,role:n,url:e,useSimplifiedRoles:s})},t.prototype.shareObjectRaw=function(e){return this.clone(he,null).shareObject(e,!0)},t.prototype.unshareObject=function(e){return this.clone(he,null).unshareObjectWeb(e)},t}(de),ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getShareLink=function(e,t){return void 0===e&&(e=ne.OrganizationView),void 0===t&&(t=null),this.clone(he,null).getShareLink(e,t)},t.prototype.shareWith=function(e,t,n,r){return void 0===t&&(t=re.View),void 0===n&&(n=!1),this.clone(he,null).shareWith(e,t,n,!1,r)},t.prototype.checkSharingPermissions=function(e){return this.clone(he,null).checkPermissions(e)},t.prototype.getSharingInformation=function(e,t){return void 0===e&&(e=null),this.clone(he,null).getSharingInformation(e,t)},t.prototype.getObjectSharingSettings=function(e){return void 0===e&&(e=!0),this.clone(he,null).getObjectSharingSettings(e)},t.prototype.unshare=function(){return this.clone(he,null).unshareObject()},t.prototype.deleteSharingLinkByKind=function(e){return this.clone(he,null).deleteLinkByKind(e)},t.prototype.unshareLink=function(e,t){return this.clone(he,null).unshareLink(e,t)},t}(de),me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getShareLink=function(e,t){void 0===e&&(e=ne.OrganizationView),void 0===t&&(t=null);var n=this.addBatchDependency();return this.getShareable().then(function(r){return n(),r.getShareLink(e,t)})},t.prototype.checkSharingPermissions=function(e){var t=this.addBatchDependency();return this.getShareable().then(function(n){return t(),n.checkPermissions(e)})},t.prototype.getSharingInformation=function(e,t){void 0===e&&(e=null);var n=this.addBatchDependency();return this.getShareable().then(function(r){return n(),r.getSharingInformation(e,t)})},t.prototype.getObjectSharingSettings=function(e){void 0===e&&(e=!0);var t=this.addBatchDependency();return this.getShareable().then(function(n){return t(),n.getObjectSharingSettings(e)})},t.prototype.unshare=function(){var e=this.addBatchDependency();return this.getShareable().then(function(t){return e(),t.unshareObject()})},t.prototype.deleteSharingLinkByKind=function(e){var t=this.addBatchDependency();return this.getShareable().then(function(n){return t(),n.deleteLinkByKind(e)})},t.prototype.unshareLink=function(e,t){var n=this.addBatchDependency();return this.getShareable().then(function(r){return n(),r.unshareLink(e,t)})},t.prototype.getShareable=function(){var e=this;return this.clone(ye,"listItemAllFields",!1).select("odata.id").get().then(function(t){var n=new he(u(t));return e.hasBatch&&(n=n.inBatch(e.batch)),n})},t}(R),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shareWith=function(e,t,n,r){void 0===t&&(t=re.View),void 0===n&&(n=!1);var o=this.addBatchDependency();return this.getShareable().then(function(i){return o(),i.shareWith(e,t,n,!1,r)})},t}(me),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shareWith=function(e,t,n,r,o){void 0===t&&(t=re.View),void 0===n&&(n=!1),void 0===r&&(r=!1);var i=this.addBatchDependency();return this.getShareable().then(function(a){return i(),a.shareWith(e,t,n,r,o)})},t}(me),ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"webparts",{get:function(){return new Se(this,"webparts")},enumerable:!0,configurable:!0}),t.prototype.export=function(e){return this.clone(t,"ExportWebPart").postCore({body:Object(y.n)({webPartId:e})})},t.prototype.import=function(e){return this.clone(t,"ImportWebPart").postCore({body:Object(y.n)({webPartXml:e})})},t}(x),Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){return new Te(this,"getbyid('"+e+"')")},t.prototype.getByControlId=function(e){return new Te(this,"getByControlId('"+e+"')")},t}(j),Te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"webpart",{get:function(){return new Oe(this)},enumerable:!0,configurable:!0}),t.prototype.saveChanges=function(){return this.clone(t,"SaveWebPartChanges").postCore()},t.prototype.moveTo=function(e,n){return this.clone(t,"MoveWebPartTo(zoneID='"+e+"', zoneIndex="+n+")").postCore()},t.prototype.close=function(){return this.clone(t,"CloseWebPart").postCore()},t.prototype.open=function(){return this.clone(t,"OpenWebPart").postCore()},t.prototype.delete=function(){return this.clone(t,"DeleteWebPart").postCore()},t}(R),Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("webpart")],t)}(R),we=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getByName=function(e){var t=new Ce(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e){var t=this;return this.clone(n,"add('"+e+"')").postCore().then(function(n){return{data:n,folder:t.getByName(e)}})},t.prototype.addUsingPath=function(e,t){var r=this;return void 0===t&&(t=!1),this.clone(n,"addUsingPath(DecodedUrl='"+e+"',overwrite="+t+")").postCore().then(function(t){return{data:t,folder:new Ce(s(r.toUrl()),"_api/web/getFolderByServerRelativePath(decodedUrl='"+e+"')")}})};var n;return t=n=o([h("folders")],t)}(j),Ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.update=t._update("SP.Folder",function(e){return{data:e,folder:t}}),t}return r(t,e),Object.defineProperty(t.prototype,"contentTypeOrder",{get:function(){return new j(this,"contentTypeOrder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"files",{get:function(){return new et(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folders",{get:function(){return new we(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listItemAllFields",{get:function(){return new R(this,"listItemAllFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentFolder",{get:function(){return new t(this,"parentFolder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return new R(this,"properties")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"serverRelativeUrl",{get:function(){return new x(this,"serverRelativeUrl")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uniqueContentTypeOrder",{get:function(){return new j(this,"uniqueContentTypeOrder")},enumerable:!0,configurable:!0}),t.prototype.delete=function(e){return void 0===e&&(e="*"),this.clone(t,null).postCore({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.recycle=function(){return this.clone(t,"recycle").postCore()},t.prototype.getItem=function(){for(var e=[],t=0;t0&&r.forEach(function(e,t){return i.query.set(t,e)}),i.postCore({body:Object(y.n)(o)})},t.prototype.renderListFormData=function(e,n,r){return this.clone(t,"renderlistformdata(itemid="+e+", formid='"+n+"', mode='"+r+"')").postCore().then(function(e){return JSON.parse(Object(y.j)(e,"RenderListFormData")?e.RenderListFormData:e)})},t.prototype.reserveListItemId=function(){return this.clone(t,"reservelistitemid").postCore().then(function(e){return Object(y.j)(e,"ReserveListItemId")?e.ReserveListItemId:e})},t.prototype.getListItemEntityTypeFullName=function(){return this.clone(t,null,!1).select("ListItemEntityTypeFullName").get().then(function(e){return e.ListItemEntityTypeFullName})},t.prototype.addValidateUpdateItemUsingPath=function(e,n,r,o){return void 0===r&&(r=!1),this.clone(t,"AddValidateUpdateItemUsingPath()").postCore({body:Object(y.n)({bNewDocumentUpdate:r,checkInComment:o,formValues:e,listItemCreateInfo:{FolderPath:{DecodedUrl:n,__metadata:{type:"SP.ResourcePath"}},__metadata:{type:"SP.ListItemCreationInformationUsingPath"}}})}).then(function(e){return void 0!==e.AddValidateUpdateItemUsingPath?e.AddValidateUpdateItemUsingPath.results:e})},t.prototype.getSiteScript=function(){return i(this,void 0,void 0,function(){var e,n;return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t).rootFolder.select("ServerRelativeUrl").get()];case 1:return e=r.sent(),[4,p(e.ServerRelativeUrl)];case 2:return n=r.sent(),[2,new S.a(this,"").getSiteScriptFromList(n)]}})})},t}(de),We=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e){var t=this;"string"==typeof e&&(e={text:e});var r=Object(y.n)(Object(y.f)(d("Microsoft.SharePoint.Comments.comment"),e));return this.clone(n,null).postCore({body:r}).then(function(e){return Object(y.f)(t.getById(e.id),e)})},t.prototype.getById=function(e){var t=new Ke(this);return t.concat("("+e+")"),t},t.prototype.clear=function(){return this.clone(n,"DeleteAll").postCore()};var n;return t=n=o([h("comments")],t)}(j),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"replies",{get:function(){return new Ve(this)},enumerable:!0,configurable:!0}),t.prototype.like=function(){return this.clone(t,"Like").postCore()},t.prototype.unlike=function(){return this.clone(t,"Unlike").postCore()},t.prototype.delete=function(){return this.deleteCore()},t}(R),Ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e){"string"==typeof e&&(e={text:e});var t=Object(y.n)(Object(y.f)(d("Microsoft.SharePoint.Comments.comment"),e));return this.clone(n,null).postCore({body:t}).then(function(e){return Object(y.f)(new Ke(u(e)),e)})};var n;return t=n=o([h("replies")],t)}(j),Qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){var t=new ze(this);return t.concat("("+e+")"),t},t.prototype.getItemByStringId=function(e){return new ze(this.parentUrl,"getItemByStringId('"+e+"')")},t.prototype.skip=function(e,t){return void 0===t&&(t=!1),t?this.query.set("$skiptoken",encodeURIComponent("Paged=TRUE&PagedPrev=TRUE&p_ID="+e)):this.query.set("$skiptoken",encodeURIComponent("Paged=TRUE&p_ID="+e)),this},t.prototype.getPaged=function(e){return void 0===e&&(e=new v.f),this.get(new $e(this,e))},t.prototype.getAll=function(e,t){void 0===e&&(e=2e3),void 0===t&&(t="application/json;odata=nometadata"),b.a.write("Calling items.getAll should be done sparingly. Ensure this is the correct choice. If you are unsure, it is not.",2);var r=new n(this,"").top(e).configure({headers:{Accept:t}});return this.query.forEach(function(e,t){/^\$select|filter|top|expand$/i.test(t)&&r.query.set(t,e)}),new Promise(function(e,t){var n=[],o=function(r){[].push.apply(n,r.results),r.hasNext?r.getNext().then(o).catch(t):e(n)};r.getPaged().then(o).catch(t)})},t.prototype.add=function(e,t){var r=this;void 0===e&&(e={}),void 0===t&&(t=null);var o=this.addBatchDependency();return this.ensureListItemEntityTypeName(t).then(function(t){var i=Object(y.n)(Object(y.f)(d(t),e)),a=r.clone(n,"").postCore({body:i}).then(function(e){return{data:e,item:r.getById(e.Id)}});return o(),a})},t.prototype.ensureListItemEntityTypeName=function(e){return e?Promise.resolve(e):this.getParent(He).getListItemEntityTypeFullName()};var n;return t=n=o([h("items")],t)}(j),ze=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._deleteWithETag,t}return r(t,e),Object.defineProperty(t.prototype,"attachmentFiles",{get:function(){return new Ne(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentType",{get:function(){return new _e(this,"ContentType")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return new We(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissions",{get:function(){return new x(this,"EffectiveBasePermissions")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissionsForUI",{get:function(){return new x(this,"EffectiveBasePermissionsForUI")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesAsHTML",{get:function(){return new R(this,"FieldValuesAsHTML")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesAsText",{get:function(){return new R(this,"FieldValuesAsText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesForEdit",{get:function(){return new R(this,"FieldValuesForEdit")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folder",{get:function(){return new Ce(this,"folder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"file",{get:function(){return new tt(this,"file")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"versions",{get:function(){return new Je(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"list",{get:function(){return this.getParent(He,this.parentUrl.substr(0,this.parentUrl.lastIndexOf("/")))},enumerable:!0,configurable:!0}),t.prototype.update=function(e,t,n){var r=this;return void 0===t&&(t="*"),void 0===n&&(n=null),new Promise(function(o,i){var a=r.addBatchDependency();return r.ensureListItemEntityTypeName(n).then(function(n){var i=Object(y.n)(Object(y.f)(d(n),e));return a(),r.postCore({body:i,headers:{"IF-Match":t,"X-HTTP-Method":"MERGE"}},new Ze).then(function(e){o({data:e,item:r})})}).catch(function(e){return i(e)})})},t.prototype.getLikedBy=function(){return this.clone(t,"likedBy").postCore()},t.prototype.like=function(){return this.clone(t,"like").postCore()},t.prototype.unlike=function(){return this.clone(t,"unlike").postCore()},t.prototype.recycle=function(){return this.clone(t,"recycle").postCore()},t.prototype.getWopiFrameUrl=function(e){void 0===e&&(e=0);var n=this.clone(t,"getWOPIFrameUrl(@action)");return n.query.set("@action",e),n.postCore().then(function(e){return Object(y.j)(e,"GetWOPIFrameUrl")?e.GetWOPIFrameUrl:e})},t.prototype.validateUpdateListItem=function(e,n){return void 0===n&&(n=!1),this.clone(t,"validateupdatelistitem").postCore({body:Object(y.n)({formValues:e,bNewDocumentUpdate:n})})},t.prototype.getLikedByInformation=function(){return this.clone(t,"likedByInformation").expand("likedby").getCore()},t.prototype.ensureListItemEntityTypeName=function(e){return e?Promise.resolve(e):this.list.getListItemEntityTypeFullName()},t}(ge),Je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){var t=new Xe(this);return t.concat("("+e+")"),t},t=o([h("versions")],t)}(j),Xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._deleteWithETag,t}return r(t,e),t}(R),Ye=function(){function e(e,t,n,r){this.parent=e,this.nextUrl=t,this.results=n,this.innerParser=r}return Object.defineProperty(e.prototype,"hasNext",{get:function(){return"string"==typeof this.nextUrl&&this.nextUrl.length>0},enumerable:!0,configurable:!0}),e.prototype.getNext=function(){if(this.hasNext){return new Qe(this.nextUrl,null).configureFrom(this.parent).getPaged(this.innerParser)}return new Promise(function(e){return e(null)})},e}(),$e=function(e){function t(t,n){var r=e.call(this)||this;return r._parent=t,r.innerParser=n,r}return r(t,e),t.prototype.parse=function(e){var t=this;return this.innerParser.parse(e).then(function(e){return i(t,void 0,void 0,function(){var t,n;return a(this,function(r){return t=this.innerParser.rawJson,n=Object(y.j)(t,"d")&&Object(y.j)(t.d,"__next")?t.d.__next:t["odata.nextLink"],[2,new Ye(this._parent,n,e,this.innerParser)]})})})},t}(v.g),Ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.parse=function(e){return i(this,void 0,void 0,function(){var t=this;return a(this,function(n){return[2,new Promise(function(n,r){t.handleError(e,r)&&n({"odata.etag":e.headers.get("etag")})})]})})},t}(v.g),et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getByName=function(e){var t=new tt(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,t,r){var o=this;return void 0===r&&(r=!0),new n(this,"add(overwrite="+r+",url='"+e+"')").postCore({body:t}).then(function(t){return{data:t,file:o.getByName(e)}})},t.prototype.addUsingPath=function(e,t,r){var o=this;void 0===r&&(r={Overwrite:!1});var i=["AddUsingPath(decodedurl='"+e+"'"];return r&&(r.Overwrite&&i.push(",Overwrite=true"),r.AutoCheckoutOnInvalidData&&i.push(",AutoCheckoutOnInvalidData=true"),Object(y.r)(r.XorHash)||i.push(",XorHash="+r.XorHash)),i.push(")"),new n(this,i.join("")).postCore({body:t}).then(function(t){return{data:t,file:o.getByName(e)}})},t.prototype.addChunked=function(e,t,r,o,i){var a=this;return void 0===o&&(o=!0),void 0===i&&(i=10485760),this.clone(n,"add(overwrite = "+o+", url = '"+e+"')",!1).postCore().then(function(){return a.getByName(e)}).then(function(e){return e.setContentChunked(t,r,i)})},t.prototype.addTemplateFile=function(e,t){var r=this;return this.clone(n,"addTemplateFile(urloffile = '"+e+"', templatefiletype = "+t+")",!1).postCore().then(function(t){return{data:t,file:r.getByName(e)}})};var n;return t=n=o([h("files")],t)}(j),tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"listItemAllFields",{get:function(){return new R(this,"listItemAllFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"versions",{get:function(){return new nt(this)},enumerable:!0,configurable:!0}),t.prototype.approve=function(e){return void 0===e&&(e=""),this.clone(t,"approve(comment = '"+e+"')").postCore()},t.prototype.cancelUpload=function(e){return this.clone(t,"cancelUpload(uploadId = guid'"+e+"')",!1).postCore()},t.prototype.checkin=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=pe.Major),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"checkin(comment = '"+e+"', checkintype = "+n+")").postCore()},t.prototype.checkout=function(){return this.clone(t,"checkout").postCore()},t.prototype.copyTo=function(e,n){return void 0===n&&(n=!0),this.clone(t,"copyTo(strnewurl = '"+e+"', boverwrite = "+n+")").postCore()},t.prototype.delete=function(e){return void 0===e&&(e="*"),this.clone(t,null).postCore({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.deny=function(e){if(void 0===e&&(e=""),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"deny(comment = '"+e+"')").postCore()},t.prototype.getLimitedWebPartManager=function(e){return void 0===e&&(e=ot.Shared),new ve(this,"getLimitedWebPartManager(scope = "+e+")")},t.prototype.moveTo=function(e,n){return void 0===n&&(n=it.Overwrite),this.clone(t,"moveTo(newurl = '"+e+"', flags = "+n+")").postCore()},t.prototype.publish=function(e){if(void 0===e&&(e=""),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"publish(comment = '"+e+"')").postCore()},t.prototype.recycle=function(){return this.clone(t,"recycle").postCore()},t.prototype.undoCheckout=function(){return this.clone(t,"undoCheckout").postCore()},t.prototype.unpublish=function(e){if(void 0===e&&(e=""),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"unpublish(comment = '"+e+"')").postCore()},t.prototype.getText=function(){return this.clone(t,"$value",!1).get(new v.i,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBlob=function(){return this.clone(t,"$value",!1).get(new v.a,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBuffer=function(){return this.clone(t,"$value",!1).get(new v.b,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getJSON=function(){return this.clone(t,"$value",!1).get(new v.d,{headers:{binaryStringResponseBody:"true"}})},t.prototype.setContent=function(e){var n=this;return this.clone(t,"$value",!1).postCore({body:e,headers:{"X-HTTP-Method":"PUT"}}).then(function(e){return new t(n)})},t.prototype.getItem=function(){for(var e=this,t=[],n=0;n0?"tenantappcatalog":"sitecollectionappcatalog";return new t(s(this.toUrl()),"_api/web/"+o+"/add(overwrite="+r+",url='"+e+"')").postCore({body:n}).then(function(e){return{data:e,file:new tt(u(e))}})},t}(j),ct=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.deploy=function(e){return void 0===e&&(e=!1),this.clone(t,"Deploy("+e+")").postCore()},t.prototype.retract=function(){return this.clone(t,"Retract").postCore()},t.prototype.install=function(){return this.clone(t,"Install").postCore()},t.prototype.uninstall=function(){return this.clone(t,"Uninstall").postCore()},t.prototype.upgrade=function(){return this.clone(t,"Upgrade").postCore()},t.prototype.remove=function(){return this.clone(t,"Remove").postCore()},t}(R),lt=function(e){function t(t){var n=e.call(this)||this;return n.baseUrl=t,n}return r(t,e),t.ParseResponse=function(e){return new Promise(function(t,n){for(var r,o,i=[],a=new RegExp("^HTTP/[0-9.]+ +([0-9]+) +(.*)","i"),s=e.split("\n"),u="batch",c=0;c0&&(o.push("--changeset_"+i+"--\n\n"),i=""),o.push("--batch_"+e.batchId+"\n")):(i.length<1&&(i=Object(y.h)(),o.push("--batch_"+e.batchId+"\n"),o.push('Content-Type: multipart/mixed; boundary="changeset_'+i+'"\n\n')),o.push("--changeset_"+i+"\n")),o.push("Content-Type: application/http\n"),o.push("Content-Transfer-Encoding: binary\n\n");var u=new Headers,c=Object(y.m)(s.url)?s.url:Object(y.d)(r,s.url);if(b.a.write("["+e.batchId+"] ("+(new Date).getTime()+") Adding request "+s.method+" "+c+" to batch.",0),"GET"!==s.method){var l=s.method,p=s.options.headers;Object(y.j)(s,"options")&&Object(y.j)(s.options,"headers")&&void 0!==p["X-HTTP-Method"]&&(l=p["X-HTTP-Method"],delete p["X-HTTP-Method"]),o.push(l+" "+c+" HTTP/1.1\n"),u.set("Content-Type","application/json;odata=verbose;charset=utf-8")}else o.push(s.method+" "+c+" HTTP/1.1\n");Object(y.o)(u,C.headers),s.options&&Object(y.o)(u,s.options.headers),u.has("Accept")||u.append("Accept","application/json"),u.has("Content-Type")||u.append("Content-Type","application/json;odata=verbose;charset=utf-8"),u.has("X-ClientService-ClientTag")||u.append("X-ClientService-ClientTag","PnPCoreJS:@pnp-1.3.11"),u.forEach(function(e,t){o.push(t+": "+e+"\n")}),o.push("\n"),s.options.body&&o.push(s.options.body+"\n\n")}i.length>0&&(o.push("--changeset_"+i+"--\n\n"),i=""),o.push("--batch_"+e.batchId+"--\n");var d={body:o.join(""),headers:{"Content-Type":"multipart/mixed; boundary=batch_"+e.batchId},method:"POST"};return b.a.write("["+e.batchId+"] ("+(new Date).getTime()+") Sending batch request.",1),n.fetch(Object(y.d)(r,"/_api/$batch"),d).then(function(e){return e.text()}).then(t.ParseResponse).then(function(t){if(t.length!==e.requests.length)throw Error("Could not properly parse responses to match requests in batch.");return b.a.write("["+e.batchId+"] ("+(new Date).getTime()+") Resolving batched requests.",1),t.reduce(function(t,n,r){var o=e.requests[r];return b.a.write("["+o.id+"] ("+(new Date).getTime()+") Resolving request in batch "+e.batchId+".",1),t.then(function(e){return o.parser.parse(n).then(o.resolve).catch(o.reject)})},Promise.resolve())})})},t}(v.e),pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e,t){var r=this;return void 0===t&&(t=!1),this.clone(n,"add").postCore({body:Object(y.n)({featdefScope:0,featureId:e,force:t})}).then(function(t){return{data:t,feature:r.getById(e)}})},t.prototype.getById=function(e){var t=new dt(this);return t.concat("('"+e+"')"),t},t.prototype.remove=function(e,t){return void 0===t&&(t=!1),this.clone(n,"remove").postCore({body:Object(y.n)({featureId:e,force:t})})};var n;return t=n=o([h("features")],t)}(j),dt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.deactivate=function(e){var n=this;void 0===e&&(e=!1);var r=this.addBatchDependency();return new t(this).select("DefinitionId").get().then(function(t){var o=n.getParent(pt,n.parentUrl,"",n.batch).remove(t.DefinitionId,e);return r(),o})},t}(R),ht=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,Object.defineProperty(t.prototype,"rootWeb",{get:function(){return new It(this,"rootweb")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"features",{get:function(){return new pt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new Be(this)},enumerable:!0,configurable:!0}),t.prototype.getRootWeb=function(){return this.rootWeb.select("Url").get().then(function(e){return new It(e.Url)})},t.prototype.getContextInfo=function(){return new n(this.parentUrl,"_api/contextinfo").postCore().then(function(e){if(Object(y.j)(e,"GetContextWebInformation")){var t=e.GetContextWebInformation;return t.SupportedSchemaVersions=t.SupportedSchemaVersions.results,t}return e})},t.prototype.getDocumentLibraries=function(e){var t=new x("","_api/sp.web.getdocumentlibraries(@v)");return t.query.set("@v","'"+e+"'"),t.get().then(function(e){return Object(y.j)(e,"GetDocumentLibraries")?e.GetDocumentLibraries:e})},t.prototype.getWebUrlFromPageUrl=function(e){var t=new x("","_api/sp.web.getweburlfrompageurl(@v)");return t.query.set("@v","'"+e+"'"),t.get().then(function(e){return Object(y.j)(e,"GetWebUrlFromPageUrl")?e.GetWebUrlFromPageUrl:e})},t.prototype.getChanges=function(e){var t=Object(y.n)({query:Object(y.f)({__metadata:{type:"SP.ChangeQuery"}},e)});return this.clone(n,"getchanges").postCore({body:t})},t.prototype.delete=function(){return i(this,void 0,void 0,function(){var e,t;return a(this,function(r){switch(r.label){case 0:return[4,this.clone(n,"").select("Id").get()];case 1:return e=r.sent(),t=new n(this.parentUrl,"_api/SPSiteManager/Delete"),[4,t.postCore({body:Object(y.n)({siteId:e.Id})})];case 2:return r.sent(),[2]}})})},t.prototype.createBatch=function(){return new lt(this.parentUrl)},t.prototype.openWebById=function(e){return this.clone(n,"openWebById('"+e+"')").postCore().then(function(e){return{data:e,web:It.fromUrl(e["odata.id"]||e.__metadata.uri)}})},t.prototype.joinHubSite=function(e){return this.clone(n,"joinHubSite('"+e+"')").postCore()},t.prototype.registerHubSite=function(){return this.clone(n,"registerHubSite").postCore()},t.prototype.unRegisterHubSite=function(){return this.clone(n,"unRegisterHubSite").postCore()},t.prototype.createCommunicationSite=function(e,t,n,r,o,s,u,c,l){var p=this;void 0===t&&(t=1033),void 0===n&&(n=!1),void 0===o&&(o=""),void 0===s&&(s=""),void 0===u&&(u="00000000-0000-0000-0000-000000000000"),void 0===c&&(c="00000000-0000-0000-0000-000000000000");var d={Classification:s,Description:o,HubSiteId:c,Lcid:t,Owner:l,ShareByEmailEnabled:n,SiteDesignId:u,Title:e,Url:r,WebTemplate:"SITEPAGEPUBLISHING#0",WebTemplateExtensionId:"00000000-0000-0000-0000-000000000000"},h=Object(y.n)({request:Object(y.f)({__metadata:{type:"Microsoft.SharePoint.Portal.SPSiteCreationRequest"}},d)});return this.getRootWeb().then(function(e){return i(p,void 0,void 0,function(){var t,n;return a(this,function(r){return t=new E,n=e.parentUrl+"/_api/SPSiteManager/Create",[2,t.post(n,{body:h,headers:{Accept:"application/json;odata=verbose","Content-Type":"application/json;odata=verbose;charset=utf-8"}}).then(function(e){return e.json()}).then(function(e){if(Object(y.j)(e,"error"))throw e;return Object(y.j)(e,"d")&&Object(y.j)(e.d,"Create")?e.d.Create:e})]})})})},t.prototype.createModernTeamSite=function(e,t,n,r,o,s,u,c,l){var p=this;void 0===n&&(n=!0),void 0===r&&(r=1033),void 0===o&&(o=""),void 0===s&&(s=""),void 0===c&&(c="00000000-0000-0000-0000-000000000000");var d={alias:t,displayName:e,isPublic:n,optionalParams:{Classification:s,CreationOptions:{results:["SPSiteLanguage:"+r,"HubSiteId:"+c]},Description:o,Owners:{results:u||[]}}};return l&&d.optionalParams.CreationOptions.results.push("implicit_formula_292aa8a00786498a87a5ca52d9f4214a_"+l),this.getRootWeb().then(function(e){return i(p,void 0,void 0,function(){var t,n;return a(this,function(r){return t=new E,n=e.parentUrl+"/_api/GroupSiteManager/CreateGroupEx",[2,t.post(n,{body:Object(y.n)(d),headers:{Accept:"application/json;odata=verbose","Content-Type":"application/json;odata=verbose;charset=utf-8"}}).then(function(e){return e.json()})]})})})};var n;return t=n=o([h("_api/site")],t)}(R),ft=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){var t=new gt(this);return t.concat("("+e+")"),t},t.prototype.add=function(e,n,r){var o=this;void 0===r&&(r=!0);var i=Object(y.n)(Object(y.f)(d("SP.NavigationNode"),{IsVisible:r,Title:e,Url:n}));return this.clone(t,null).postCore({body:i}).then(function(e){return{data:e,node:o.getById(e.Id)}})},t.prototype.moveAfter=function(e,n){var r=Object(y.n)({nodeId:e,previousNodeId:n});return this.clone(t,"MoveAfter").postCore({body:r})},t}(j),gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return new ft(this,"Children")},enumerable:!0,configurable:!0}),t.prototype.delete=function(){return e.prototype.deleteCore.call(this)},t.prototype.update=function(e){var t=this,n=Object(y.n)(Object(y.f)({__metadata:{type:"SP.NavigationNode"}},e));return this.postCore({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,node:t}})},t}(R),mt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"quicklaunch",{get:function(){return new ft(this,"quicklaunch")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topNavigationBar",{get:function(){return new ft(this,"topnavigationbar")},enumerable:!0,configurable:!0}),t=o([h("navigation")],t)}(x),yt=function(e){function t(t,n){return void 0===n&&(n=null),e.call(this,t,n)||this}return r(t,e),t.prototype.getMenuState=function(e,n,r,o){return void 0===e&&(e=null),void 0===n&&(n=10),void 0===r&&(r=null),void 0===o&&(o=null),new t(this,"_api/navigation/MenuState").postCore({body:Object(y.n)({customProperties:o,depth:n,mapProviderName:r,menuNodeKey:e})})},t.prototype.getMenuNodeKey=function(e,n){return void 0===n&&(n=null),new t(this,"_api/navigation/MenuNodeKey").postCore({body:Object(y.n)({currentUrl:e,mapProviderName:n})})},t}(x),bt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.FromUrl=function(e){if(null===e)return new n("");var t=e.indexOf("_api/");return new n(t>-1?e.substr(0,t):e)},t.prototype.getRelatedItems=function(e,t){var r=this.clone(n,null);return r.concat(".GetRelatedItems"),r.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e})})},t.prototype.getPageOneRelatedItems=function(e,t){var r=this.clone(n,null);return r.concat(".GetPageOneRelatedItems"),r.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e})})},t.prototype.addSingleLink=function(e,t,r,o,i,a,s){void 0===s&&(s=!1);var u=this.clone(n,null);return u.concat(".AddSingleLink"),u.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e,SourceWebUrl:r,TargetItemID:i,TargetListName:o,TargetWebUrl:a,TryAddReverseLink:s})})},t.prototype.addSingleLinkToUrl=function(e,t,r,o){void 0===o&&(o=!1);var i=this.clone(n,null);return i.concat(".AddSingleLinkToUrl"),i.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e,TargetItemUrl:r,TryAddReverseLink:o})})},t.prototype.addSingleLinkFromUrl=function(e,t,r,o){void 0===o&&(o=!1);var i=this.clone(n,null);return i.concat(".AddSingleLinkFromUrl"),i.postCore({body:Object(y.n)({SourceItemUrl:e,TargetItemID:r,TargetListName:t,TryAddReverseLink:o})})},t.prototype.deleteSingleLink=function(e,t,r,o,i,a,s){void 0===s&&(s=!1);var u=this.clone(n,null);return u.concat(".DeleteSingleLink"),u.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e,SourceWebUrl:r,TargetItemID:i,TargetListName:o,TargetWebUrl:a,TryDeleteReverseLink:s})})};var n;return t=n=o([h("_api/SP.RelatedItemManager")],t)}(x),vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"installedLanguages",{get:function(){return new St(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"globalInstalledLanguages",{get:function(){return new St(this,"globalinstalledlanguages")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeZone",{get:function(){return new Tt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeZones",{get:function(){return new Ot(this)},enumerable:!0,configurable:!0}),t=o([h("regionalsettings")],t)}(R),St=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("installedlanguages")],t)}(j),Tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.utcToLocalTime=function(e){var t;return t="string"==typeof e?e:e.toISOString(),this.clone(n,"utctolocaltime('"+t+"')").postCore().then(function(e){return Object(y.j)(e,"UTCToLocalTime")?e.UTCToLocalTime:e})},t.prototype.localTimeToUTC=function(e){var t;return t="string"==typeof e?e:Object(y.e)(e,"minute",-1*e.getTimezoneOffset()).toISOString(),this.clone(n,"localtimetoutc('"+t+"')").postCore().then(function(e){return Object(y.j)(e,"LocalTimeToUTC")?e.LocalTimeToUTC:e})};var n;return t=n=o([h("timezone")],t)}(R),Ot=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){return this.clone(n,"GetById("+e+")").postCore({},c(Tt))};var n;return t=n=o([h("timezones")],t)}(j),wt=function(e){function t(n,r){return e.call(this,t.getBaseUrl(n),"_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility."+r)||this}return r(t,e),t.getBaseUrl=function(e){if("string"==typeof e)return e;var t=e,n=t.toUrl(),r=n.indexOf("_api/");return r<0?n:n.substr(0,r)},t.prototype.execute=function(e){return this.postCore({body:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8"}})},t.prototype.createSiteDesign=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"CreateSiteDesign").execute({info:e})];case 1:return[2,n.sent()]}})})},t.prototype.applySiteDesign=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"ApplySiteDesign").execute({siteDesignId:e,webUrl:n})];case 1:return[2,r.sent()]}})})},t.prototype.getSiteDesigns=function(){return i(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.clone(t,"GetSiteDesigns").execute({})];case 1:return[2,e.sent()]}})})},t.prototype.getSiteDesignMetadata=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteDesignMetadata").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.updateSiteDesign=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"UpdateSiteDesign").execute({updateInfo:e})];case 1:return[2,n.sent()]}})})},t.prototype.deleteSiteDesign=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"DeleteSiteDesign").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.getSiteDesignRights=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteDesignRights").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.grantSiteDesignRights=function(e,n,r){return void 0===r&&(r=1),i(this,void 0,void 0,function(){return a(this,function(o){switch(o.label){case 0:return[4,this.clone(t,"GrantSiteDesignRights").execute({grantedRights:r.toString(),id:e,principalNames:n})];case 1:return[2,o.sent()]}})})},t.prototype.revokeSiteDesignRights=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"RevokeSiteDesignRights").execute({id:e,principalNames:n})];case 1:return[2,r.sent()]}})})},t.prototype.addSiteDesignTask=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"AddSiteDesignTask").execute({webUrl:e,siteDesignId:n})];case 1:return[2,r.sent()]}})})},t.prototype.addSiteDesignTaskToCurrentWeb=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"AddSiteDesignTaskToCurrentWeb").execute({siteDesignId:e})];case 1:return[2,n.sent()]}})})},t.prototype.getSiteDesignTask=function(e){return i(this,void 0,void 0,function(){var n;return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"GetSiteDesignTask").execute({taskId:e})];case 1:return n=r.sent(),[2,Object(y.j)(n,"ID")?n:null]}})})},t.prototype.getSiteDesignRun=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"GetSiteDesignRun").execute({webUrl:e,siteDesignId:n})];case 1:return[2,r.sent()]}})})},t.prototype.getSiteDesignRunStatus=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"GetSiteDesignRunStatus").execute({webUrl:e,runId:n})];case 1:return[2,r.sent()]}})})},t}(x),Ct=function(e){function t(n,r){return e.call(this,t.getBaseUrl(n),"_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility."+r)||this}return r(t,e),t.getBaseUrl=function(e){if("string"==typeof e)return e;var t=e,n=t.toUrl(),r=n.indexOf("_api/");return r<0?n:n.substr(0,r)},t.prototype.execute=function(e){return this.postCore({body:JSON.stringify(e)})},t.prototype.getSiteScripts=function(){return this.clone(t,"GetSiteScripts",!0).execute({})},t.prototype.createSiteScript=function(e,n,r){return i(this,void 0,void 0,function(){return a(this,function(o){switch(o.label){case 0:return[4,this.clone(t,"CreateSiteScript(Title=@title,Description=@desc)?@title='"+encodeURIComponent(e)+"'&@desc='"+encodeURIComponent(n)+"'").execute(r)];case 1:return[2,o.sent()]}})})},t.prototype.getSiteScriptMetadata=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteScriptMetadata").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.deleteSiteScript=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"DeleteSiteScript").execute({id:e})];case 1:return n.sent(),[2]}})})},t.prototype.updateSiteScript=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return n&&(e.Content=JSON.stringify(n)),[4,this.clone(t,"UpdateSiteScript").execute({updateInfo:e})];case 1:return[2,r.sent()]}})})},t.prototype.getSiteScriptFromList=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteScriptFromList").execute({listUrl:e})];case 1:return[2,n.sent()]}})})},t.prototype.getSiteScriptFromWeb=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"getSiteScriptFromWeb").execute({webUrl:e,info:n})];case 1:return[2,r.sent()]}})})},t}(x),Pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e,t,r,o,i,a){void 0===r&&(r=""),void 0===o&&(o="STS"),void 0===i&&(i=1033),void 0===a&&(a=!0);var s={Description:r,Language:i,Title:e,Url:t,UseSamePermissionsAsParentSite:a,WebTemplate:o},c=Object(y.n)({parameters:Object(y.f)({__metadata:{type:"SP.WebCreationInformation"}},s)});return this.clone(n,"add").postCore({body:c}).then(function(e){return{data:e,web:new It(u(e).replace(/_api\/web\/?/i,""))}})};var n;return t=n=o([h("webs")],t)}(j),_t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("webinfos")],t)}(j),It=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.fromUrl=function(e,t){return new n(s(e),t)},Object.defineProperty(t.prototype,"webs",{get:function(){return new Pt(this)},enumerable:!0,configurable:!0}),t.prototype.getParentWeb=function(){var e=this;return this.select("ParentWeb/Id").expand("ParentWeb").get().then(function(t){var n=t.ParentWeb;return n?new ht(e.parentUrl).openWebById(n.Id):null})},t.prototype.getSubwebsFilteredForCurrentUser=function(e,t){return void 0===e&&(e=-1),void 0===t&&(t=-1),this.clone(Pt,"getSubwebsFilteredForCurrentUser(nWebTemplateFilter="+e+",nConfigurationFilter="+t+")")},Object.defineProperty(t.prototype,"allProperties",{get:function(){return this.clone(R,"allproperties")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"webinfos",{get:function(){return new _t(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentTypes",{get:function(){return new Pe(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lists",{get:function(){return new qe(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fields",{get:function(){return new Ue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"features",{get:function(){return new pt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"availablefields",{get:function(){return new Ue(this,"availablefields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"navigation",{get:function(){return new mt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteUsers",{get:function(){return new A(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteGroups",{get:function(){return new M(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteUserInfoList",{get:function(){return new He(this,"siteuserinfolist")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"regionalSettings",{get:function(){return new vt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){return new L(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folders",{get:function(){return new we(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new Be(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"roleDefinitions",{get:function(){return new q(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relatedItems",{get:function(){return bt.FromUrl(this.toUrl())},enumerable:!0,configurable:!0}),t.prototype.createBatch=function(){return new lt(this.parentUrl)},Object.defineProperty(t.prototype,"rootFolder",{get:function(){return new Ce(this,"rootFolder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedOwnerGroup",{get:function(){return new F(this,"associatedownergroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedMemberGroup",{get:function(){return new F(this,"associatedmembergroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedVisitorGroup",{get:function(){return new F(this,"associatedvisitorgroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultDocumentLibrary",{get:function(){return new He(this,"DefaultDocumentLibrary")},enumerable:!0,configurable:!0}),t.prototype.getFolderById=function(e){return new Ce(this,"getFolderById('"+e+"')")},t.prototype.getFolderByServerRelativeUrl=function(e){return new Ce(this,"getFolderByServerRelativeUrl('"+e+"')")},t.prototype.getFolderByServerRelativePath=function(e){return new Ce(this,"getFolderByServerRelativePath(decodedUrl='"+e+"')")},t.prototype.getFileById=function(e){return new tt(this,"getFileById('"+e+"')")},t.prototype.getFileByServerRelativeUrl=function(e){return new tt(this,"getFileByServerRelativeUrl('"+e+"')")},t.prototype.getFileByServerRelativePath=function(e){return new tt(this,"getFileByServerRelativePath(decodedUrl='"+e+"')")},t.prototype.getList=function(e){return new He(this,"getList('"+e+"')")},t.prototype.update=function(e){var t=this,n=Object(y.n)(Object(y.f)({__metadata:{type:"SP.Web"}},e));return this.postCore({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,web:t}})},t.prototype.delete=function(){return e.prototype.deleteCore.call(this)},t.prototype.applyTheme=function(e,t,r,o){var i=Object(y.n)({backgroundImageUrl:r,colorPaletteUrl:e,fontSchemeUrl:t,shareGenerated:o});return this.clone(n,"applytheme").postCore({body:i})},t.prototype.applyWebTemplate=function(e){var t=this.clone(n,"applywebtemplate");return t.concat("(@t)"),t.query.set("@t",e),t.postCore()},t.prototype.ensureUser=function(e){var t=Object(y.n)({logonName:e});return this.clone(n,"ensureuser").postCore({body:t}).then(function(e){return{data:e,user:new k(u(e))}})},t.prototype.availableWebTemplates=function(e,t){return void 0===e&&(e=1033),void 0===t&&(t=!0),new j(this,"getavailablewebtemplates(lcid="+e+", doincludecrosslanguage="+t+")")},t.prototype.getCatalog=function(e){return this.clone(n,"getcatalog("+e+")").select("Id").get().then(function(e){return new He(u(e))})},t.prototype.getChanges=function(e){var t=Object(y.n)({query:Object(y.f)({__metadata:{type:"SP.ChangeQuery"}},e)});return this.clone(n,"getchanges").postCore({body:t})},Object.defineProperty(t.prototype,"customListTemplate",{get:function(){return new j(this,"getcustomlisttemplates")},enumerable:!0,configurable:!0}),t.prototype.getUserById=function(e){return new k(this,"getUserById("+e+")")},t.prototype.mapToIcon=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=""),this.clone(n,"maptoicon(filename='"+e+"', progid='"+r+"', size="+t+")").get()},t.prototype.getStorageEntity=function(e){return this.clone(n,"getStorageEntity('"+e+"')").get()},t.prototype.setStorageEntity=function(e,t,r,o){return void 0===r&&(r=""),void 0===o&&(o=""),this.clone(n,"setStorageEntity").postCore({body:Object(y.n)({comments:o,description:r,key:e,value:t})})},t.prototype.removeStorageEntity=function(e){return this.clone(n,"removeStorageEntity('"+e+"')").postCore()},t.prototype.getAppCatalog=function(e){return new ut(e||this)},t.prototype.getSiteCollectionAppCatalog=function(e){return new ut(e||this,"_api/web/sitecollectionappcatalog/AvailableApps")},t.prototype.getClientSideWebParts=function(){return this.clone(j,"GetClientSideWebParts").get()},t.prototype.addClientSidePage=function(e,t){return void 0===t&&(t=e.replace(/\.[^\/.]+$/,"")),Nt.create(this,e,t)},t.prototype.addClientSidePageByPath=function(e,t){return void 0===t&&(t=e.replace(/\.[^\/.]+$/,"")),Nt.create(this,e,t)},t.prototype.createDefaultAssociatedGroups=function(e,t,r){var o=this.clone(n,"createDefaultAssociatedGroups(userLogin=@u,userLogin2=@v,groupNameSeed=@s)");return o.query.set("@u","'"+encodeURIComponent(e||"")+"'"),o.query.set("@v","'"+encodeURIComponent(t||"")+"'"),o.query.set("@s","'"+encodeURIComponent(r||"")+"'"),o.postCore()},t.prototype.hubSiteData=function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(t){return[2,this.clone(n,"hubSiteData("+e+")").get().then(function(e){return JSON.parse(e)})]})})},t.prototype.syncHubSiteTheme=function(){return this.clone(n,"syncHubSiteTheme").postCore()},t.prototype.getSiteDesignRuns=function(e){return new wt(this,"").getSiteDesignRun(void 0,e)},t.prototype.getSiteScript=function(e){return new Ct(this,"").getSiteScriptFromWeb(void 0,e)},t.prototype.addSiteDesignTask=function(e){return new wt(this,"").addSiteDesignTaskToCurrentWeb(e)},t.prototype.getSiteDesignRunStatus=function(e){return new wt(this,"").getSiteDesignRunStatus(void 0,e)};var n;return t=n=o([h("_api/web")],t)}(fe);!function(e){e[e.NotPromoted=0]="NotPromoted",e[e.PromoteOnPublish=1]="PromoteOnPublish",e[e.Promoted=2]="Promoted"}(st||(st={}));var Et,Nt=function(e){function t(n,r,o,i,a,u){void 0===i&&(i=!1),void 0===a&&(a=[]),void 0===u&&(u=!1);var c=e.call(this,n,r)||this;return c.json=o,c.sections=a,c.commentsDisabled=u,c._bannerImageDirty=!1,"string"==typeof n?(c._parentUrl="",c._url=Object(y.d)(s(n),r)):c.extend(t.initFrom(n,null),r),c._pageSettings={controlType:0,pageSettingsSlice:{isDefaultDescription:!0,isDefaultThumbnail:!0}},c._layoutPart=t.getDefaultLayoutPart(),void 0===o||i||c.fromJSON(o),c}return r(t,e),t.create=function(e,n,r,o,s){return void 0===o&&(o="Article"),void 0===s&&(s=0),i(this,void 0,void 0,function(){var i,u;return a(this,function(a){switch(a.label){case 0:return n=n.replace(/\.aspx$/i,""),[4,t.initFrom(e,"_api/sitepages/pages").postCore({body:Object(y.n)(Object.assign(d("SP.Publishing.SitePage"),{PageLayoutType:o,PromotedState:s}))})];case 1:return i=a.sent(),u=new t(e,"",i),u.title=n,[4,u.save(!1)];case 2:return a.sent(),u.title=r,[2,u]}})})},t.fromFile=function(e){return e.getItem().then(function(n){return new t(s(e.toUrl()),"",{Id:n.Id},!0).configureFrom(e).load()})},t.getDefaultLayoutPart=function(){return{dataVersion:"1.4",description:"Title Region Description",id:"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788",instanceId:"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788",properties:{authors:[],layoutType:"FullWidthImage",showPublishDate:!1,showTopicHeader:!1,textAlignment:"Left",title:"",topicHeader:""},serverProcessedContent:{htmlStrings:{},searchablePlainTexts:{},imageSources:{},links:{}},title:"Title area"}},t.initFrom=function(e,n){return new t(s(e.toUrl()),n).configureFrom(e)},Object.defineProperty(t.prototype,"pageLayout",{get:function(){return this.json.PageLayoutType},set:function(e){this.json.PageLayoutType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bannerImageUrl",{get:function(){return this.json.BannerImageUrl},set:function(e){this.json.BannerImageUrl=e,this._bannerImageDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bannerImageSourceType",{get:function(){return this._layoutPart.properties.imageSourceType},set:function(e){this._layoutPart.properties.imageSourceType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topicHeader",{get:function(){return Object(y.q)(this.json.TopicHeader)?this.json.TopicHeader:""},set:function(e){this.json.TopicHeader=e,this._layoutPart.properties.topicHeader=e,Object(y.r)(e)&&(this.showTopicHeader=!1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._layoutPart.properties.title},set:function(e){this.json.Title=e,this._layoutPart.properties.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layoutType",{get:function(){return this._layoutPart.properties.layoutType},set:function(e){this._layoutPart.properties.layoutType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerTextAlignment",{get:function(){return this._layoutPart.properties.textAlignment},set:function(e){this._layoutPart.properties.textAlignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showTopicHeader",{get:function(){return this._layoutPart.properties.showTopicHeader},set:function(e){this._layoutPart.properties.showTopicHeader=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showPublishDate",{get:function(){return this._layoutPart.properties.showPublishDate},set:function(e){this._layoutPart.properties.showPublishDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasVerticalSection",{get:function(){return this.sections.findIndex(function(e){return 2===e.layoutIndex})>-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"verticalSection",{get:function(){return this.hasVerticalSection?this.addVerticalSection():null},enumerable:!0,configurable:!0}),t.prototype.addSection=function(){var e=new xt(this,f(this.sections),1);return this.sections.push(e),e},t.prototype.addVerticalSection=function(){var e=this.sections.findIndex(function(e){return 2===e.layoutIndex});if(e>-1)return this.sections[e];var t=new xt(this,f(this.sections),2);return this.sections.push(t),t},t.prototype.fromJSON=function(e){this.json=e;var t=JSON.parse(e.CanvasContent1),n=JSON.parse(e.LayoutWebpartsContent);return n&&n.length>0&&(this._layoutPart=n[0]),this.setControls(t),this},t.prototype.load=function(){var e=this;return this.getItem("Id","CommentsDisabled").then(function(t){return new x(e,"_api/sitepages/pages("+t.Id+")").get().then(function(n){return e.commentsDisabled=t.CommentsDisabled,e.fromJSON(n)})})},t.prototype.save=function(e){var n=this;if(void 0===e&&(e=!0),null===this.json.Id)throw Error("The id for this page is null. If you want to create a new page, please use ClientSidePage.Create");var r=Promise.resolve({});return this._bannerImageDirty&&(r=r.then(function(e){return new Promise(function(e,t){var r=n.json.BannerImageUrl;Object(y.m)(r)&&(r=r.replace(/^https?:\/\/[a-z0-9\.]*?\.[a-z]{2,3}\//i,"/"));var o=new ht(s(n.toUrl())),i=new It(s(n.toUrl())),a=i.getFileByServerRelativePath(r),u="",c="",l="",p="",d="";Promise.all([o.select("Id","Url").get().then(function(e){return u=e.Id}),i.select("Id","Url").get().then(function(e){c=e.Id,d=e.Url}),a.listItemAllFields.select("UniqueId","ParentList/Id").expand("ParentList").get().then(function(e){l=e.UniqueId,p=e.ParentList.Id})]).then(function(){var t=new x(d,"_layouts/15/getpreview.ashx");t.query.set("guidSite",""+u),t.query.set("guidWeb",""+c),t.query.set("guidFile",""+l),n.bannerImageUrl=t.toUrlAndQuery(),Object(y.q)(n._layoutPart.serverProcessedContent)||(n._layoutPart.serverProcessedContent={}),n._layoutPart.serverProcessedContent.imageSources={imageSource:r},Object(y.q)(n._layoutPart.serverProcessedContent.customMetadata)||(n._layoutPart.serverProcessedContent.customMetadata={}),n._layoutPart.serverProcessedContent.customMetadata.imageSource={listId:p,siteId:u,uniqueId:l,webId:c},n._layoutPart.properties.webId=c,n._layoutPart.properties.siteId=u,n._layoutPart.properties.listId=p,n._layoutPart.properties.uniqueId=l,e()}).catch(t)})})),this.json.IsPageCheckedOutToCurrentUser||(r=r.then(function(e){return t.initFrom(n,"_api/sitepages/pages("+n.json.Id+")/checkoutpage").postCore()})),r=r.then(function(e){var r=Object.assign(d("SP.Publishing.SitePage"),{AuthorByline:n.json.AuthorByline||[],BannerImageUrl:n.bannerImageUrl,CanvasContent1:n.getCanvasContent1(),LayoutWebpartsContent:n.getLayoutWebpartsContent(),Title:n.title,TopicHeader:n.topicHeader}),o=t.initFrom(n,"_api/sitepages/pages("+n.json.Id+")/savepage");return o.configure({headers:{"if-match":"*"}}),o.postCore({body:Object(y.n)(r)})}),e&&(r=r.then(function(e){return t.initFrom(n,"_api/sitepages/pages("+n.json.Id+")/publish").postCore()}).then(function(e){e&&(n.json.IsPageCheckedOutToCurrentUser=!1)})),r=r.then(function(e){n._bannerImageDirty=!1})},t.prototype.discardPageCheckout=function(){return i(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:if(null===this.json.Id)throw Error("The id for this page is null. If you want to create a new page, please use ClientSidePage.Create");return[4,t.initFrom(this,"_api/sitepages/pages("+this.json.Id+")/discardPage").postCore({body:Object(y.n)(d("SP.Publishing.SitePage"))})];case 1:return e=n.sent(),this.fromJSON(e),[2]}})})},t.prototype.promoteToNews=function(){return i(this,void 0,void 0,function(){return a(this,function(e){return[2,this.promoteNewsImpl("promoteToNews")]})})},t.prototype.enableComments=function(){var e=this;return this.setCommentsOn(!0).then(function(t){return e.commentsDisabled=!1,t})},t.prototype.disableComments=function(){var e=this;return this.setCommentsOn(!1).then(function(t){return e.commentsDisabled=!0,t})},t.prototype.findControlById=function(e){return this.findControl(function(t){return t.id===e})},t.prototype.findControl=function(e){for(var t=0;t3?{}:{zoneEmphasis:e}},t.prototype.setCommentsOn=function(e){return this.getItem().then(function(t){return new ze(t,"SetCommentsDisabled("+!e+")").update({})})},t.prototype.promoteNewsImpl=function(e){return i(this,void 0,void 0,function(){var n,r;return a(this,function(o){switch(o.label){case 0:return Object(y.r)(this.json.VersionInfo.LastVersionCreatedBy)?(n=new Date(this.json.VersionInfo.LastVersionCreated),n.getFullYear()<2e3?[4,this.save(!0)]:[3,2]):[3,2];case 1:o.sent(),o.label=2;case 2:if(null===this.json.Id)throw Error("The id for this page is null. If you want to create a new page, please use ClientSidePage.Create");return[4,t.initFrom(this,"_api/sitepages/pages("+this.json.Id+")/"+e).postCore({body:Object(y.n)(d("SP.Publishing.SitePage"))})];case 3:return r=o.sent(),[2,r]}})})},t.prototype.mergePartToTree=function(e,t){var n=null,r=12,o=0,i=0,a=1;t&&(Object(y.j)(t,"zoneIndex")&&(i=t.zoneIndex),Object(y.j)(t,"sectionIndex")&&(o=t.sectionIndex),Object(y.j)(t,"sectionFactor")&&(r=t.sectionFactor),Object(y.j)(t,"layoutIndex")&&(a=t.layoutIndex));var s=e.data&&e.data.emphasis&&e.data.emphasis.zoneEmphasis?e.data.emphasis.zoneEmphasis:0,u=this.getOrCreateSection(i,a,s),c=u.columns.filter(function(e){return e.order===o});n=c.length<1?u.addColumn(r,a):c[0],e.column=n,n.addControl(e)},t.prototype.mergeColumnToTree=function(e){var t=Object(y.j)(e.data,"position")&&Object(y.j)(e.data.position,"zoneIndex")?e.data.position.zoneIndex:0,n=Object(y.j)(e.data,"position")&&Object(y.j)(e.data.position,"layoutIndex")?e.data.position.layoutIndex:1,r=this.getOrCreateSection(t,n,e.data.emphasis.zoneEmphasis||0);e.section=r,r.columns.push(e)},t.prototype.getOrCreateSection=function(e,t,n){var r=null,o=this.sections.filter(function(n){return n.order===e&&n.layoutIndex===t});return o.length<1?(r=2===t?this.addVerticalSection():this.addSection(),r.order=e,r.emphasis=n):r=o[0],r},t.prototype.getItem=function(){for(var e=this,n=[],r=0;r")||(e="

"+e+"

"),this.data.innerHTML=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.data.position.controlIndex},set:function(e){this.data.position.controlIndex=e},enumerable:!0,configurable:!0}),t.prototype.onColumnChange=function(e){this.data.position.sectionFactor=e.factor,this.data.position.controlIndex=f(e.controls),this.data.position.zoneIndex=e.data.position.zoneIndex,this.data.position.sectionIndex=e.order,this.data.position.layoutIndex=e.data.position.layoutIndex},t.Default={addedFromPersistedData:!1,anchorComponentId:"",controlType:4,displayMode:2,editorType:"CKEditor",emphasis:{},id:"",innerHTML:"",position:{controlIndex:1,layoutIndex:1,sectionFactor:12,sectionIndex:1,zoneIndex:1}},t}(Rt),Ut=function(e){function t(n){return void 0===n&&(n=JSON.parse(JSON.stringify(t.Default))),e.call(this,n)||this}return r(t,e),t.fromComponentDef=function(e){var n=new t;return n.import(e),n},Object.defineProperty(t.prototype,"title",{get:function(){return this.data.webPartData.title},set:function(e){this.data.webPartData.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this.data.webPartData.description},set:function(e){this.data.webPartData.description=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.data.position.controlIndex},set:function(e){this.data.position.controlIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.data.reservedHeight},set:function(e){this.data.reservedHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.data.reservedWidth},set:function(e){this.data.reservedWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataVersion",{get:function(){return this.data.webPartData.dataVersion},set:function(e){this.data.webPartData.dataVersion=e},enumerable:!0,configurable:!0}),t.prototype.setProperties=function(e){return this.data.webPartData.properties=Object(y.f)(this.data.webPartData.properties,e),this},t.prototype.getProperties=function(){return this.data.webPartData.properties},t.prototype.onColumnChange=function(e){this.data.position={controlIndex:f(e.controls),layoutIndex:e.data.position.layoutIndex,sectionFactor:e.factor,sectionIndex:e.data.position.sectionIndex,zoneIndex:e.data.position.zoneIndex}},t.prototype.import=function(e){var t=Object(y.h)(),n=e.Id.replace(/^\{|\}$/g,"").toLowerCase(),r=JSON.parse(e.Manifest),o=r.preconfiguredEntries[0];this.setData(Object.assign({},this.data,{id:t,webPartData:{dataVersion:"1.0",description:o.description.default,id:n,instanceId:t,properties:o.properties,title:o.title.default},webPartId:n}))},t.Default={addedFromPersistedData:!1,controlType:3,displayMode:2,emphasis:{},id:null,position:{controlIndex:1,layoutIndex:1,sectionFactor:12,sectionIndex:1,zoneIndex:1},reservedHeight:500,reservedWidth:500,webPartData:null,webPartId:null},t}(Rt),kt=(new Map([["text","Querytext"],["template","QueryTemplate"],["sourceId","SourceId"],["trimDuplicatesIncludeId",""],["startRow",""],["rowLimit",""],["rankingModelId",""],["rowsPerPage",""],["selectProperties",""],["culture",""],["timeZoneId",""],["refinementFilters",""],["refiners",""],["hiddenConstraints",""],["sortList",""],["timeout",""],["hithighlightedProperties",""],["clientType",""],["personalizationData",""],["resultsURL",""],["queryTag",""],["properties",""],["queryTemplatePropertiesUrl",""],["reorderingRules",""],["hitHighlightedMultivaluePropertyLimit",""],["collapseSpecification",""],["uiLanguage",""],["desiredSnippetLength",""],["maxSnippetLength",""],["summaryLength",""]]),new Map([]),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.execute=function(e){var t=this,n=this.parseQuery(e),r=Object(y.n)({request:Object(y.f)(d("Microsoft.Office.Server.Search.REST.SearchRequest"),Object.assign({},n,{HitHighlightedProperties:this.fixArrProp(n.HitHighlightedProperties),Properties:this.fixArrProp(n.Properties),RefinementFilters:this.fixArrProp(n.RefinementFilters),ReorderingRules:this.fixArrProp(n.ReorderingRules),SelectProperties:this.fixArrProp(n.SelectProperties),SortList:this.fixArrProp(n.SortList)}))});if(this._useCaching){this._forceCaching=!0;var o="PnPjs.SearchWithCaching("+Object(y.i)(r)+")";Object(y.q)(this._cachingOptions)?/\/_api\/search\/postquery$/i.test(this._cachingOptions.key)&&(this._cachingOptions.key=o):this._cachingOptions=new v.c(o)}return this.postCore({body:r}).then(function(e){return new Lt(e,t.toUrl(),n)})},t.prototype.fixArrProp=function(e){return void 0===e?{results:[]}:(e=Object(y.k)(e)?e:[e],Object(y.j)(e,"results")?e:{results:e})},t.prototype.parseQuery=function(e){return"string"==typeof e?{Querytext:e}:e.toSearchQuery?e.toSearchQuery():e},t=o([h("_api/search/postquery")],t)}(R)),Lt=function(){function e(e,t,n,r,o){void 0===r&&(r=null),void 0===o&&(o=null),this._url=t,this._query=n,this._raw=r,this._primary=o,this._raw=e.postquery?e.postquery:e}return Object.defineProperty(e.prototype,"ElapsedTime",{get:function(){return this.RawSearchResults.ElapsedTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"RowCount",{get:function(){return this.RawSearchResults.PrimaryQueryResult.RelevantResults.RowCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"TotalRows",{get:function(){return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"TotalRowsIncludingDuplicates",{get:function(){return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"RawSearchResults",{get:function(){return this._raw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"PrimarySearchResults",{get:function(){return null===this._primary&&(this._primary=this.formatSearchResults(this._raw.PrimaryQueryResult.RelevantResults.Table.Rows)),this._primary},enumerable:!0,configurable:!0}),e.prototype.getPage=function(e,t){if(this.TotalRowsthis.TotalRows?Promise.resolve(null):new kt(this._url,null).execute(r)},e.prototype.formatSearchResults=function(e){for(var t=new Array,n=e.results?e.results:e,r=0,o=n;r0&&(n.properties=Object(y.f)(n.properties,{To:{results:e.To}})),e.CC&&e.CC.length>0&&(n.properties=Object(y.f)(n.properties,{CC:{results:e.CC}})),e.BCC&&e.BCC.length>0&&(n.properties=Object(y.f)(n.properties,{BCC:{results:e.BCC}})),e.AdditionalHeaders&&(n.properties=Object(y.f)(n.properties,{AdditionalHeaders:e.AdditionalHeaders})),this.clone(t,"SendEmail",!0).excute(n)},t.prototype.getCurrentUserEmailAddresses=function(){return this.clone(t,"GetCurrentUserEmailAddresses",!0).excute({}).then(function(e){return Object(y.j)(e,"GetCurrentUserEmailAddresses")?e.GetCurrentUserEmailAddresses:e})},t.prototype.resolvePrincipal=function(e,n,r,o,i,a){void 0===a&&(a=!1);var s={addToUserInfoList:i,input:e,inputIsEmailOnly:o,matchUserInfoList:a,scopes:n,sources:r};return this.clone(t,"ResolvePrincipalInCurrentContext",!0).excute(s).then(function(e){return Object(y.j)(e,"ResolvePrincipalInCurrentContext")?e.ResolvePrincipalInCurrentContext:e})},t.prototype.searchPrincipals=function(e,n,r,o,i){var a={groupName:o,input:e,maxCount:i,scopes:n,sources:r};return this.clone(t,"SearchPrincipalsUsingContextWeb",!0).excute(a).then(function(e){return Object(y.j)(e,"SearchPrincipalsUsingContextWeb")?e.SearchPrincipalsUsingContextWeb:e})},t.prototype.createEmailBodyForInvitation=function(e){var n={pageAddress:e};return this.clone(t,"CreateEmailBodyForInvitation",!0).excute(n).then(function(e){return Object(y.j)(e,"CreateEmailBodyForInvitation")?e.CreateEmailBodyForInvitation:e})},t.prototype.expandGroupsToPrincipals=function(e,n){void 0===n&&(n=30);var r={inputs:e,maxCount:n};return this.clone(t,"ExpandGroupsToPrincipals",!0).excute(r).then(function(e){return Object(y.j)(e,"ExpandGroupsToPrincipals")?e.ExpandGroupsToPrincipals:e})},t.prototype.createWikiPage=function(e){return this.clone(t,"CreateWikiPageInContextWeb",!0).excute({parameters:e}).then(function(e){return{data:Object(y.j)(e,"CreateWikiPageInContextWeb")?e.CreateWikiPageInContextWeb:e,file:new tt(u(e))}})},t.prototype.containsInvalidFileFolderChars=function(e,n){return void 0===n&&(n=!1),n?(t.InvalidFileFolderNameCharsOnPremiseRegex.lastIndex=0,t.InvalidFileFolderNameCharsOnPremiseRegex.test(e)):(t.InvalidFileFolderNameCharsOnlineRegex.lastIndex=0,t.InvalidFileFolderNameCharsOnlineRegex.test(e))},t.prototype.stripInvalidFileFolderChars=function(e,n,r){return void 0===n&&(n=""),void 0===r&&(r=!1),r?e.replace(t.InvalidFileFolderNameCharsOnPremiseRegex,n):e.replace(t.InvalidFileFolderNameCharsOnlineRegex,n)},t.InvalidFileFolderNameCharsOnlineRegex=/["*:<>?\/\\|\x00-\x1f\x7f-\x9f]/g,t.InvalidFileFolderNameCharsOnPremiseRegex=/["#%*:<>?\/\\|\x00-\x1f\x7f-\x9f]/g,t}(x),Xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){return new Yt(this,"GetById?hubSiteId='"+e+"'")},t=o([h("_api/hubsites")],t)}(j),Yt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(R),$t=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t=""),this._options=e,this._baseUrl=t}return e.prototype.configure=function(t,n){return void 0===n&&(n=""),new e(t,n)},e.prototype.setup=function(e){l(e)},e.prototype.searchSuggest=function(e){var t;return t="string"==typeof e?{querytext:e}:e,this.create(Bt).execute(t)},e.prototype.search=function(e){return this.create(kt).execute(e)},e.prototype.searchWithCaching=function(e,t){return this.create(kt).usingCaching(t).execute(e)},Object.defineProperty(e.prototype,"site",{get:function(){return this.create(ht)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"web",{get:function(){return this.create(It)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"profiles",{get:function(){return this.create(Gt)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"social",{get:function(){return this.create(Wt)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"navigation",{get:function(){return this.create(yt)},enumerable:!0,configurable:!0}),e.prototype.createBatch=function(){return this.web.createBatch()},Object.defineProperty(e.prototype,"utility",{get:function(){return this.create(Jt,"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"siteScripts",{get:function(){return this.create(Ct,"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"siteDesigns",{get:function(){return this.create(wt,"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hubSites",{get:function(){return this.create(Xt)},enumerable:!0,configurable:!0}),e.prototype.getTenantAppCatalogWeb=function(){var e=this;return this.create(It,"_api/SP_TenantSettings_Current").get().then(function(t){return new It(t.CorporateCatalogUrl).configure(e._options)})},e.prototype.create=function(e,t){return new e(this._baseUrl,t).configure(this._options)},e}(),Zt=new $t}).call(t,n(1))},function(e,t,n){"use strict";(function(e){function r(e,t){function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){for(var n=[],r=2;r0&&(n=60*this.defaultTimeoutMinutes),t=i(new Date,"second",n)}return f({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;this.deleteExpired().then(function(t){setTimeout(o(e,e.cacheExpirationHandler),R.cacheExpirationIntervalMilliseconds)}).catch(function(e){console.error(e)})},e}(),U=function(){function e(e){void 0===e&&(e=new Map),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.size},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._store.clear()},e.prototype.getItem=function(e){return this._store.get(e)},e.prototype.key=function(e){return Array.from(this._store)[e][0]},e.prototype.removeItem=function(e){this._store.delete(e)},e.prototype.setItem=function(e,t){this._store.set(e,t)},e}(),k=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._local=e,this._session=t}return Object.defineProperty(e.prototype,"local",{get:function(){return null===this._local&&(this._local=this.getStore("local")),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=this.getStore("session")),this._session},enumerable:!0,configurable:!0}),e.prototype.getStore=function(e){return new A("local"===e?"undefined"==typeof localStorage?new U:localStorage:"undefined"==typeof sessionStorage?new U:sessionStorage)},e}()}).call(t,n(1))},function(e,t,n){"use strict";n.d(t,"a",function(){return o});/** +define("abc3361f-bb2d-491f-aba3-cd51c19a299b_1.1.1",["@microsoft/decorators","@microsoft/sp-application-base","MegaMenuApplicationCustomizerStrings","@microsoft/sp-http","@microsoft/sp-lodash-subset"],function(e,t,n,r,o){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";function r(e,t,n){for(var r=[],o=3;o=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function i(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})}function a(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,i=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(a=u.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]-1?e.substr(0,t):e}function u(e){var t=[],n=["odata.type","odata.editLink","__metadata","odata.metadata"];return Object(y.j)(e,n[0])&&"SP.Web"===e[n[0]]?Object(y.j)(e,n[1])?t.push(e[n[1]]):Object(y.j)(e,n[2])&&t.push(e.__metadata.uri):Object(y.j)(e,n[3])&&Object(y.j)(e,n[1])?t.push(s(e[n[3]]),"_api",e[n[1]]):Object(y.j)(e,n[1])?t.push("_api",e[n[1]]):Object(y.j)(e,n[2])&&t.push(e.__metadata.uri),t.length<1?(b.a.write("No uri information found in ODataEntity parsing, chaining will fail for this object.",2),""):y.d.apply(void 0,t)}function c(e){return new O(e)}function l(e){y.c.extend(e)}function p(e){return new Promise(function(t){if(Object(y.m)(e))return t(e);if(null!==C.baseUrl)return t(Object(y.d)(C.baseUrl,e));if(void 0!==N._spPageContextInfo){if(Object(y.j)(N._spPageContextInfo,"webAbsoluteUrl"))return t(Object(y.d)(N._spPageContextInfo.webAbsoluteUrl,e));if(Object(y.j)(N._spPageContextInfo,"webServerRelativeUrl"))return t(Object(y.d)(N._spPageContextInfo.webServerRelativeUrl,e))}if(void 0!==N.location){var n=N.location.toString().toLowerCase();["/_layouts/","/siteassets/"].forEach(function(r){var o=n.indexOf(r);if(o>0)return t(Object(y.d)(n.substr(0,o),e))})}return t(e)})}function d(e){return{__metadata:{type:e}}}function h(e){return function(t){return function(t){function n(){for(var n=[],r=0;r1&&void 0!==n[1]?n[1]:e)||this}return r(n,t),n}(t)}}function f(e){return e.length<1?1:Math.max.apply(null,e.map(function(e){return e.order}))+1}function g(e){for(var t=0;tt.lastIndexOf("(")){var o=t.lastIndexOf("/");r._parentUrl=t.slice(0,o),n=Object(y.d)(t.slice(o),n),r._url=Object(y.d)(r._parentUrl,n)}else{var o=t.lastIndexOf("(");r._parentUrl=t.slice(0,o),r._url=Object(y.d)(t,n)}else{r.extend(t,n);var i=t.query.get("@target");void 0!==i&&r.query.set("@target",i)}return r}return r(t,e),t.prototype.as=function(e){var t=new e(this._url,null);return Object(y.f)(t,this,!0)},t.prototype.toUrlAndQuery=function(){var e=new Map(this.query),t=this.toUrl().replace(/'!(@.*?)::(.*?)'/gi,function(t,n,r){return b.a.write("Rewriting aliased parameter from match "+t+" to label: "+n+" value: "+r,0),e.set(n,"'"+r+"'"),n});if(e.size>0){t+=""+(t.indexOf("?")>-1?"&":"?")+Array.from(e).map(function(e){return e[0]+"="+e[1]}).join("&")}return t},t.prototype.select=function(){for(var e=[],t=0;t0&&this.query.set("$select",e.join(",")),this},t.prototype.expand=function(){for(var e=[],t=0;t0&&this.query.set("$expand",e.join(",")),this},t.prototype.getParent=function(e,t,n,r){void 0===t&&(t=this.parentUrl);var o=new e(t,n).configureFrom(this),i="@target";return this.query.has(i)&&o.query.set(i,this.query.get(i)),void 0!==r&&(o=o.inBatch(r)),o},t.prototype.clone=function(t,n,r){void 0===r&&(r=!0);var o=e.prototype._clone.call(this,new t(this,n),{includeBatch:r}),i="@target";return this.query.has(i)&&o.query.set(i,this.query.get(i)),o},t.prototype.toRequestContext=function(e,t,n,r){var o=this;void 0===t&&(t={});var i=this.hasBatch?this._batchDependency:function(){};return p(this.toUrlAndQuery()).then(function(a){return Object(y.p)(t,o._options),{batch:o.batch,batchDependency:i,cachingOptions:o._cachingOptions,clientFactory:function(){return new E},isBatched:o.hasBatch,isCached:o._forceCaching||o._useCaching&&/^get$/i.test(e),options:t,parser:n,pipeline:r,requestAbsoluteUrl:a,requestId:Object(y.h)(),verb:e}})},t}(v.h),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.filter=function(e){return this.query.set("$filter",e),this},t.prototype.orderBy=function(e,t){void 0===t&&(t=!0);var n="$orderby",r=this.query.has(n)?this.query.get(n).split(","):[];return r.push(e+" "+(t?"asc":"desc")),this.query.set(n,r.join(",")),this},t.prototype.skip=function(e){return this.query.set("$skip",e.toString()),this},t.prototype.top=function(e){return this.query.set("$top",e.toString()),this},t}(x),R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype._update=function(e,t){var n=this;return function(r){return n.postCore({body:Object(y.n)(Object(y.f)(d(e),r)),headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return t(e,r)})}},t.prototype._delete=function(){return this.postCore({headers:{"X-HTTP-Method":"DELETE"}})},t.prototype._deleteWithETag=function(e){return void 0===e&&(e="*"),this.postCore({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t}(x),A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){return new k(this,"getById("+e+")")},t.prototype.getByEmail=function(e){return new k(this,"getByEmail('"+e+"')")},t.prototype.getByLoginName=function(e){var t=new k(this);return t.concat("('!@v::"+encodeURIComponent(e)+"')"),t},t.prototype.removeById=function(e){return this.clone(n,"removeById("+e+")").postCore()},t.prototype.removeByLoginName=function(e){var t=this.clone(n,"removeByLoginName(@v)");return t.query.set("@v","'"+encodeURIComponent(e)+"'"),t.postCore()},t.prototype.add=function(e){var t=this;return this.clone(n,null).postCore({body:Object(y.n)(Object(y.f)(d("SP.User"),{LoginName:e}))}).then(function(){return t.getByLoginName(e)})};var n;return t=n=o([h("siteusers")],t)}(j),U=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"groups",{get:function(){return new M(this,"groups")},enumerable:!0,configurable:!0}),t}(R),k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.update=t._update("SP.User",function(e){return{data:e,user:t}}),t.delete=t._delete,t}return r(t,e),t}(U),L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("currentuser")],t)}(U);!function(e){e[e.None=0]="None",e[e.User=1]="User",e[e.DistributionList=2]="DistributionList",e[e.SecurityGroup=4]="SecurityGroup",e[e.SharePointGroup=8]="SharePointGroup",e[e.All=15]="All"}(m||(m={}));var D,M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){var t=new F(this);return t.concat("("+e+")"),t},t.prototype.add=function(e){var t=this,n=Object(y.n)(Object(y.f)(d("SP.Group"),e));return this.postCore({body:n}).then(function(e){return{data:e,group:t.getById(e.Id)}})},t.prototype.getByName=function(e){return new F(this,"getByName('"+e+"')")},t.prototype.removeById=function(e){return this.clone(n,"removeById('"+e+"')").postCore()},t.prototype.removeByLoginName=function(e){return this.clone(n,"removeByLoginName('"+e+"')").postCore()};var n;return t=n=o([h("sitegroups")],t)}(j),F=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.update=n._update("SP.Group",function(e,r){var o=n;return Object(y.j)(r,"Title")&&(o=n.getParent(t,n.parentUrl,"getByName('"+r.Title+"')")),{data:e,group:o}}),n}return r(t,e),Object.defineProperty(t.prototype,"users",{get:function(){return new A(this,"users")},enumerable:!0,configurable:!0}),t.prototype.setUserAsOwner=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){return[2,this.clone(t,"SetUserAsOwner("+e+")").postCore()]})})},t}(R),B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){var t=new G(this);return t.concat("("+e+")"),t},t.prototype.add=function(e,t){return this.clone(n,"addroleassignment(principalid="+e+", roledefid="+t+")").postCore()},t.prototype.remove=function(e,t){return this.clone(n,"removeroleassignment(principalid="+e+", roledefid="+t+")").postCore()};var n;return t=n=o([h("roleassignments")],t)}(j),G=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._delete,t}return r(t,e),Object.defineProperty(t.prototype,"groups",{get:function(){return new M(this,"groups")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindings",{get:function(){return new W(this)},enumerable:!0,configurable:!0}),t}(R),q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){return new H(this,"getById("+e+")")},t.prototype.getByName=function(e){return new H(this,"getbyname('"+e+"')")},t.prototype.getByType=function(e){return new H(this,"getbytype("+e+")")},t.prototype.add=function(e,t,n,r){var o=this,i=Object(y.n)({BasePermissions:{High:r.High.toString(),Low:r.Low.toString()},Description:t,Name:e,Order:n,__metadata:{type:"SP.RoleDefinition"}});return this.postCore({body:i}).then(function(e){return{data:e,definition:o.getById(e.Id)}})},t=o([h("roledefinitions")],t)}(j),H=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._delete,t}return r(t,e),t.prototype.update=function(e){var t=this;void 0!==Object(y.j)(e,"BasePermissions")&&(e.BasePermissions=Object(y.f)({__metadata:{type:"SP.BasePermissions"}},{High:e.BasePermissions.High.toString(),Low:e.BasePermissions.Low.toString()}));var n=Object(y.n)(Object(y.f)(d("SP.RoleDefinition"),e));return this.postCore({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(n){var r=t;if(Object(y.j)(e,"Name")){r=t.getParent(q,t.parentUrl,"").getByName(e.Name)}return{data:n,definition:r}})},t}(R),W=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("roledefinitionbindings")],t)}(j);!function(e){e[e.Display=1]="Display",e[e.Edit=2]="Edit",e[e.New=3]="New"}(D||(D={}));var K;!function(e){e[e.Invalid=0]="Invalid",e[e.Integer=1]="Integer",e[e.Text=2]="Text",e[e.Note=3]="Note",e[e.DateTime=4]="DateTime",e[e.Counter=5]="Counter",e[e.Choice=6]="Choice",e[e.Lookup=7]="Lookup",e[e.Boolean=8]="Boolean",e[e.Number=9]="Number",e[e.Currency=10]="Currency",e[e.URL=11]="URL",e[e.Computed=12]="Computed",e[e.Threading=13]="Threading",e[e.Guid=14]="Guid",e[e.MultiChoice=15]="MultiChoice",e[e.GridChoice=16]="GridChoice",e[e.Calculated=17]="Calculated",e[e.File=18]="File",e[e.Attachments=19]="Attachments",e[e.User=20]="User",e[e.Recurrence=21]="Recurrence",e[e.CrossProjectLink=22]="CrossProjectLink",e[e.ModStat=23]="ModStat",e[e.Error=24]="Error",e[e.ContentTypeId=25]="ContentTypeId",e[e.PageSeparator=26]="PageSeparator",e[e.ThreadIndex=27]="ThreadIndex",e[e.WorkflowStatus=28]="WorkflowStatus",e[e.AllDayEvent=29]="AllDayEvent",e[e.WorkflowEventType=30]="WorkflowEventType"}(K||(K={}));var V;!function(e){e[e.DateOnly=0]="DateOnly",e[e.DateTime=1]="DateTime"}(V||(V={}));var Q;!function(e){e[e.Unspecified=0]="Unspecified",e[e.Disabled=1]="Disabled",e[e.Relative=2]="Relative"}(Q||(Q={}));var z;!function(e){e[e.DefaultValue=0]="DefaultValue",e[e.AddToDefaultContentType=1]="AddToDefaultContentType",e[e.AddToNoContentType=2]="AddToNoContentType",e[e.AddToAllContentTypes=4]="AddToAllContentTypes",e[e.AddFieldInternalNameHint=8]="AddFieldInternalNameHint",e[e.AddFieldToDefaultView=16]="AddFieldToDefaultView",e[e.AddFieldCheckDisplayName=32]="AddFieldCheckDisplayName"}(z||(z={}));var J;!function(e){e[e.Gregorian=1]="Gregorian",e[e.Japan=3]="Japan",e[e.Taiwan=4]="Taiwan",e[e.Korea=5]="Korea",e[e.Hijri=6]="Hijri",e[e.Thai=7]="Thai",e[e.Hebrew=8]="Hebrew",e[e.GregorianMEFrench=9]="GregorianMEFrench",e[e.GregorianArabic=10]="GregorianArabic",e[e.GregorianXLITEnglish=11]="GregorianXLITEnglish",e[e.GregorianXLITFrench=12]="GregorianXLITFrench",e[e.KoreaJapanLunar=14]="KoreaJapanLunar",e[e.ChineseLunar=15]="ChineseLunar",e[e.SakaEra=16]="SakaEra",e[e.UmAlQura=23]="UmAlQura"}(J||(J={}));var X;!function(e){e[e.Hyperlink=0]="Hyperlink",e[e.Image=1]="Image"}(X||(X={}));var Y;!function(e){e[e.EmptyMask=0]="EmptyMask",e[e.ViewListItems=1]="ViewListItems",e[e.AddListItems=2]="AddListItems",e[e.EditListItems=3]="EditListItems",e[e.DeleteListItems=4]="DeleteListItems",e[e.ApproveItems=5]="ApproveItems",e[e.OpenItems=6]="OpenItems",e[e.ViewVersions=7]="ViewVersions",e[e.DeleteVersions=8]="DeleteVersions",e[e.CancelCheckout=9]="CancelCheckout",e[e.ManagePersonalViews=10]="ManagePersonalViews",e[e.ManageLists=12]="ManageLists",e[e.ViewFormPages=13]="ViewFormPages",e[e.AnonymousSearchAccessList=14]="AnonymousSearchAccessList",e[e.Open=17]="Open",e[e.ViewPages=18]="ViewPages",e[e.AddAndCustomizePages=19]="AddAndCustomizePages",e[e.ApplyThemeAndBorder=20]="ApplyThemeAndBorder",e[e.ApplyStyleSheets=21]="ApplyStyleSheets",e[e.ViewUsageData=22]="ViewUsageData",e[e.CreateSSCSite=23]="CreateSSCSite",e[e.ManageSubwebs=24]="ManageSubwebs",e[e.CreateGroups=25]="CreateGroups",e[e.ManagePermissions=26]="ManagePermissions",e[e.BrowseDirectories=27]="BrowseDirectories",e[e.BrowseUserInfo=28]="BrowseUserInfo",e[e.AddDelPrivateWebParts=29]="AddDelPrivateWebParts",e[e.UpdatePersonalWebParts=30]="UpdatePersonalWebParts",e[e.ManageWeb=31]="ManageWeb",e[e.AnonymousSearchAccessWebLists=32]="AnonymousSearchAccessWebLists",e[e.UseClientIntegration=37]="UseClientIntegration",e[e.UseRemoteAPIs=38]="UseRemoteAPIs",e[e.ManageAlerts=39]="ManageAlerts",e[e.CreateAlerts=40]="CreateAlerts",e[e.EditMyUserInfo=41]="EditMyUserInfo",e[e.EnumeratePermissions=63]="EnumeratePermissions",e[e.FullMask=65]="FullMask"}(Y||(Y={}));var $;!function(e){e[e.None=0]="None",e[e.User=1]="User",e[e.DistributionList=2]="DistributionList",e[e.SecurityGroup=4]="SecurityGroup",e[e.SharePointGroup=8]="SharePointGroup",e[e.All=15]="All"}($||($={}));var Z;!function(e){e[e.None=0]="None",e[e.UserInfoList=1]="UserInfoList",e[e.Windows=2]="Windows",e[e.MembershipProvider=4]="MembershipProvider",e[e.RoleProvider=8]="RoleProvider",e[e.All=15]="All"}(Z||(Z={}));var ee;!function(e){e[e.None=0]="None",e[e.Guest=1]="Guest",e[e.Reader=2]="Reader",e[e.Contributor=3]="Contributor",e[e.WebDesigner=4]="WebDesigner",e[e.Administrator=5]="Administrator"}(ee||(ee={}));var te;!function(e){e[e.Invalid=-1]="Invalid",e[e.DefaultView=0]="DefaultView",e[e.NormalView=1]="NormalView",e[e.DialogView=2]="DialogView",e[e.View=3]="View",e[e.DisplayForm=4]="DisplayForm",e[e.DisplayFormDialog=5]="DisplayFormDialog",e[e.EditForm=6]="EditForm",e[e.EditFormDialog=7]="EditFormDialog",e[e.NewForm=8]="NewForm",e[e.NewFormDialog=9]="NewFormDialog",e[e.SolutionForm=10]="SolutionForm",e[e.PAGE_MAXITEMS=11]="PAGE_MAXITEMS"}(te||(te={}));var ne;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Direct=1]="Direct",e[e.OrganizationView=2]="OrganizationView",e[e.OrganizationEdit=3]="OrganizationEdit",e[e.AnonymousView=4]="AnonymousView",e[e.AnonymousEdit=5]="AnonymousEdit",e[e.Flexible=6]="Flexible"}(ne||(ne={}));var re;!function(e){e[e.None=0]="None",e[e.View=1]="View",e[e.Edit=2]="Edit",e[e.Owner=3]="Owner"}(re||(re={}));var oe;!function(e){e[e.CompletedSuccessfully=0]="CompletedSuccessfully",e[e.AccessRequestsQueued=1]="AccessRequestsQueued",e[e.NoResolvedUsers=-1]="NoResolvedUsers",e[e.AccessDenied=-2]="AccessDenied",e[e.CrossSiteRequestNotSupported=-3]="CrossSiteRequestNotSupported",e[e.UnknowError=-4]="UnknowError",e[e.EmailBodyTooLong=-5]="EmailBodyTooLong",e[e.ListUniqueScopesExceeded=-6]="ListUniqueScopesExceeded",e[e.CapabilityDisabled=-7]="CapabilityDisabled",e[e.ObjectNotSupported=-8]="ObjectNotSupported",e[e.NestedGroupsNotSupported=-9]="NestedGroupsNotSupported"}(oe||(oe={}));var ie;!function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Folder=2]="Folder",e[e.Item=3]="Item",e[e.List=4]="List",e[e.Web=5]="Web",e[e.Max=6]="Max"}(ie||(ie={}));var ae;!function(e){e[e.None=0]="None",e[e.AllowList=1]="AllowList",e[e.BlockList=2]="BlockList"}(ae||(ae={}));var se;!function(e){e[e.None=0]="None",e[e.ContextInfo=1]="ContextInfo",e[e.ListData=2]="ListData",e[e.ListSchema=4]="ListSchema",e[e.MenuView=8]="MenuView",e[e.ListContentType=16]="ListContentType",e[e.FileSystemItemId=32]="FileSystemItemId",e[e.ClientFormSchema=64]="ClientFormSchema",e[e.QuickLaunch=128]="QuickLaunch",e[e.Spotlight=256]="Spotlight",e[e.Visualization=512]="Visualization",e[e.ViewMetadata=1024]="ViewMetadata",e[e.DisableAutoHyperlink=2048]="DisableAutoHyperlink",e[e.EnableMediaTAUrls=4096]="EnableMediaTAUrls",e[e.ParentInfo=8192]="ParentInfo",e[e.PageContextInfo=16384]="PageContextInfo",e[e.ClientSideComponentManifest=32768]="ClientSideComponentManifest"}(se||(se={}));var ue;!function(e){e[e.PeopleAndGroups=1]="PeopleAndGroups",e[e.PeopleOnly=0]="PeopleOnly"}(ue||(ue={}));var ce;!function(e){e[e.Dropdown=0]="Dropdown",e[e.RadioButtons=1]="RadioButtons"}(ce||(ce={}));var le;!function(e){e[e.DefaultZone=0]="DefaultZone",e[e.Intranet=1]="Intranet",e[e.Internet=2]="Internet",e[e.Custom=3]="Custom",e[e.Extranet=4]="Extranet"}(le||(le={}));var pe,de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"roleAssignments",{get:function(){return new B(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstUniqueAncestorSecurableObject",{get:function(){return new R(this,"FirstUniqueAncestorSecurableObject")},enumerable:!0,configurable:!0}),t.prototype.getUserEffectivePermissions=function(e){var t=this.clone(x,"getUserEffectivePermissions(@user)");return t.query.set("@user","'"+encodeURIComponent(e)+"'"),t.get().then(function(e){return Object(y.j)(e,"GetUserEffectivePermissions")?e.GetUserEffectivePermissions:e})},t.prototype.getCurrentUserEffectivePermissions=function(){return this.clone(x,"EffectiveBasePermissions").get().then(function(e){return Object(y.j)(e,"EffectiveBasePermissions")?e.EffectiveBasePermissions:e})},t.prototype.breakRoleInheritance=function(e,n){return void 0===e&&(e=!1),void 0===n&&(n=!1),this.clone(t,"breakroleinheritance(copyroleassignments="+e+", clearsubscopes="+n+")").postCore()},t.prototype.resetRoleInheritance=function(){return this.clone(t,"resetroleinheritance").postCore()},t.prototype.userHasPermissions=function(e,t){var n=this;return this.getUserEffectivePermissions(e).then(function(e){return n.hasPermissions(e,t)})},t.prototype.currentUserHasPermissions=function(e){var t=this;return this.getCurrentUserEffectivePermissions().then(function(n){return t.hasPermissions(n,e)})},t.prototype.hasPermissions=function(e,t){if(!t)return!0;if(t===Y.FullMask)return 32767==(32767&e.High)&&65535===e.Low;t-=1;var n=1;return t>=0&&t<32?(n<<=t,0!=(e.Low&n)):t>=32&&t<64&&(n<<=t-32,0!=(e.High&n))},t}(R),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getShareLink=function(e,n){void 0===n&&(n=null);var r=null!==n?n.toISOString():null;return this.clone(t,"shareLink").postCore({body:Object(y.n)({request:{createLink:!0,emailData:null,settings:{expiration:r,linkKind:e}}})})},t.prototype.shareWith=function(e,n,r,o,i){var a=this;void 0===r&&(r=!1),void 0===o&&(o=!1),Array.isArray(e)||(e=[e]);var s=Object(y.n)(e.map(function(e){return{Key:e}})),u=n===re.Edit?ee.Contributor:ee.Reader;return new j("_api/web","roledefinitions").select("Id").filter("RoleTypeKind eq "+u).get().then(function(e){if(!Array.isArray(e)||e.length<1)throw Error("Could not locate a role defintion with RoleTypeKind "+u);var n={includeAnonymousLinkInEmail:r,peoplePickerInput:s,propagateAcl:o,roleValue:"role:"+e[0].Id,useSimplifiedRoles:!0};return void 0!==i&&(n=Object(y.f)(n,{emailBody:i.body,emailSubject:void 0!==i.subject?i.subject:"",sendEmail:!0})),a.clone(t,"shareObject").postCore({body:Object(y.n)(n)})})},t.prototype.shareObject=function(e,t){var n=this;return void 0===t&&(t=!1),t?this.sendShareObjectRequest(e):(e=Object(y.f)(e,{group:null,includeAnonymousLinkInEmail:!1,propagateAcl:!1,useSimplifiedRoles:!0},!0),this.getRoleValue(e.role,e.group).then(function(t){Array.isArray(e.loginNames)||(e.loginNames=[e.loginNames]);var r=Object(y.n)(e.loginNames.map(function(e){return{Key:e}})),o={peoplePickerInput:r,roleValue:t,url:e.url};return void 0!==e.emailData&&null!==e.emailData&&(o=Object(y.f)(o,{emailBody:e.emailData.body,emailSubject:void 0!==e.emailData.subject?e.emailData.subject:"Shared with you.",sendEmail:!0})),n.sendShareObjectRequest(o)}))},t.prototype.unshareObjectWeb=function(e){return this.clone(t,"unshareObject").postCore({body:Object(y.n)({url:e})})},t.prototype.checkPermissions=function(e){return this.clone(t,"checkPermissions").postCore({body:Object(y.n)({recipients:e})})},t.prototype.getSharingInformation=function(e,n){void 0===e&&(e=null);var r=this.clone(t,"getSharingInformation");return r.expand.apply(r,n).postCore({body:Object(y.n)({request:e})})},t.prototype.getObjectSharingSettings=function(e){return void 0===e&&(e=!0),this.clone(t,"getObjectSharingSettings").postCore({body:Object(y.n)({useSimplifiedRoles:e})})},t.prototype.unshareObject=function(){return this.clone(t,"unshareObject").postCore()},t.prototype.deleteLinkByKind=function(e){return this.clone(t,"deleteLinkByKind").postCore({body:Object(y.n)({linkKind:e})})},t.prototype.unshareLink=function(e,n){return void 0===n&&(n="00000000-0000-0000-0000-000000000000"),this.clone(t,"unshareLink").postCore({body:Object(y.n)({linkKind:e,shareId:n})})},t.prototype.getRoleValue=function(e,t){if(void 0===t||null===t){var n=e===re.Edit?ee.Contributor:ee.Reader;return new j("_api/web","roledefinitions").select("Id").top(1).filter("RoleTypeKind eq "+n).get().then(function(e){if(e.length<1)throw Error("Could not locate associated role definition for supplied role. Edit and View are supported");return"role: "+e[0].Id})}switch(t){case ee.Contributor:return new R("_api/web","associatedmembergroup").select("Id").get().then(function(e){return"group: "+e.Id});case ee.Reader:case ee.Guest:return new R("_api/web","associatedvisitorgroup").select("Id").get().then(function(e){return"group: "+e.Id});default:throw Error("Could not determine role value for supplied value. Contributor, Reader, and Guest are supported")}},t.prototype.getShareObjectWeb=function(e){return Promise.resolve(new R(s(e),"/_api/SP.Web.ShareObject"))},t.prototype.sendShareObjectRequest=function(e){return this.getShareObjectWeb(this.toUrl()).then(function(n){return n.expand("UsersWithAccessRequests","GroupsSharedWith").as(t).postCore({body:Object(y.n)(e)})})},t}(x),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shareWith=function(e,t,n){var r=this;void 0===t&&(t=re.View);var o=this.addBatchDependency();return new R(s(this.toUrl()),"/_api/web/url").get().then(function(i){return o(),r.shareObject(Object(y.d)(i,"/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1"),e,t,n)})},t.prototype.shareObject=function(e,t,n,r,o,i,a,s){return void 0===i&&(i=!1),void 0===a&&(a=!1),void 0===s&&(s=!0),this.clone(he,null).shareObject({emailData:r,group:o,includeAnonymousLinkInEmail:a,loginNames:t,propagateAcl:i,role:n,url:e,useSimplifiedRoles:s})},t.prototype.shareObjectRaw=function(e){return this.clone(he,null).shareObject(e,!0)},t.prototype.unshareObject=function(e){return this.clone(he,null).unshareObjectWeb(e)},t}(de),ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getShareLink=function(e,t){return void 0===e&&(e=ne.OrganizationView),void 0===t&&(t=null),this.clone(he,null).getShareLink(e,t)},t.prototype.shareWith=function(e,t,n,r){return void 0===t&&(t=re.View),void 0===n&&(n=!1),this.clone(he,null).shareWith(e,t,n,!1,r)},t.prototype.checkSharingPermissions=function(e){return this.clone(he,null).checkPermissions(e)},t.prototype.getSharingInformation=function(e,t){return void 0===e&&(e=null),this.clone(he,null).getSharingInformation(e,t)},t.prototype.getObjectSharingSettings=function(e){return void 0===e&&(e=!0),this.clone(he,null).getObjectSharingSettings(e)},t.prototype.unshare=function(){return this.clone(he,null).unshareObject()},t.prototype.deleteSharingLinkByKind=function(e){return this.clone(he,null).deleteLinkByKind(e)},t.prototype.unshareLink=function(e,t){return this.clone(he,null).unshareLink(e,t)},t}(de),me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getShareLink=function(e,t){void 0===e&&(e=ne.OrganizationView),void 0===t&&(t=null);var n=this.addBatchDependency();return this.getShareable().then(function(r){return n(),r.getShareLink(e,t)})},t.prototype.checkSharingPermissions=function(e){var t=this.addBatchDependency();return this.getShareable().then(function(n){return t(),n.checkPermissions(e)})},t.prototype.getSharingInformation=function(e,t){void 0===e&&(e=null);var n=this.addBatchDependency();return this.getShareable().then(function(r){return n(),r.getSharingInformation(e,t)})},t.prototype.getObjectSharingSettings=function(e){void 0===e&&(e=!0);var t=this.addBatchDependency();return this.getShareable().then(function(n){return t(),n.getObjectSharingSettings(e)})},t.prototype.unshare=function(){var e=this.addBatchDependency();return this.getShareable().then(function(t){return e(),t.unshareObject()})},t.prototype.deleteSharingLinkByKind=function(e){var t=this.addBatchDependency();return this.getShareable().then(function(n){return t(),n.deleteLinkByKind(e)})},t.prototype.unshareLink=function(e,t){var n=this.addBatchDependency();return this.getShareable().then(function(r){return n(),r.unshareLink(e,t)})},t.prototype.getShareable=function(){var e=this;return this.clone(ye,"listItemAllFields",!1).select("odata.id").get().then(function(t){var n=new he(u(t));return e.hasBatch&&(n=n.inBatch(e.batch)),n})},t}(R),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shareWith=function(e,t,n,r){void 0===t&&(t=re.View),void 0===n&&(n=!1);var o=this.addBatchDependency();return this.getShareable().then(function(i){return o(),i.shareWith(e,t,n,!1,r)})},t}(me),be=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.shareWith=function(e,t,n,r,o){void 0===t&&(t=re.View),void 0===n&&(n=!1),void 0===r&&(r=!1);var i=this.addBatchDependency();return this.getShareable().then(function(a){return i(),a.shareWith(e,t,n,r,o)})},t}(me),ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"webparts",{get:function(){return new Se(this,"webparts")},enumerable:!0,configurable:!0}),t.prototype.export=function(e){return this.clone(t,"ExportWebPart").postCore({body:Object(y.n)({webPartId:e})})},t.prototype.import=function(e){return this.clone(t,"ImportWebPart").postCore({body:Object(y.n)({webPartXml:e})})},t}(x),Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){return new Te(this,"getbyid('"+e+"')")},t.prototype.getByControlId=function(e){return new Te(this,"getByControlId('"+e+"')")},t}(j),Te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"webpart",{get:function(){return new Oe(this)},enumerable:!0,configurable:!0}),t.prototype.saveChanges=function(){return this.clone(t,"SaveWebPartChanges").postCore()},t.prototype.moveTo=function(e,n){return this.clone(t,"MoveWebPartTo(zoneID='"+e+"', zoneIndex="+n+")").postCore()},t.prototype.close=function(){return this.clone(t,"CloseWebPart").postCore()},t.prototype.open=function(){return this.clone(t,"OpenWebPart").postCore()},t.prototype.delete=function(){return this.clone(t,"DeleteWebPart").postCore()},t}(R),Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("webpart")],t)}(R),we=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getByName=function(e){var t=new Ce(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e){var t=this;return this.clone(n,"add('"+e+"')").postCore().then(function(n){return{data:n,folder:t.getByName(e)}})},t.prototype.addUsingPath=function(e,t){var r=this;return void 0===t&&(t=!1),this.clone(n,"addUsingPath(DecodedUrl='"+e+"',overwrite="+t+")").postCore().then(function(t){return{data:t,folder:new Ce(s(r.toUrl()),"_api/web/getFolderByServerRelativePath(decodedUrl='"+e+"')")}})};var n;return t=n=o([h("folders")],t)}(j),Ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.update=t._update("SP.Folder",function(e){return{data:e,folder:t}}),t}return r(t,e),Object.defineProperty(t.prototype,"contentTypeOrder",{get:function(){return new j(this,"contentTypeOrder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"files",{get:function(){return new et(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folders",{get:function(){return new we(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listItemAllFields",{get:function(){return new R(this,"listItemAllFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentFolder",{get:function(){return new t(this,"parentFolder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return new R(this,"properties")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"serverRelativeUrl",{get:function(){return new x(this,"serverRelativeUrl")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uniqueContentTypeOrder",{get:function(){return new j(this,"uniqueContentTypeOrder")},enumerable:!0,configurable:!0}),t.prototype.delete=function(e){return void 0===e&&(e="*"),this.clone(t,null).postCore({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.recycle=function(){return this.clone(t,"recycle").postCore()},t.prototype.getItem=function(){for(var e=[],t=0;t0&&r.forEach(function(e,t){return i.query.set(t,e)}),i.postCore({body:Object(y.n)(o)})},t.prototype.renderListFormData=function(e,n,r){return this.clone(t,"renderlistformdata(itemid="+e+", formid='"+n+"', mode='"+r+"')").postCore().then(function(e){return JSON.parse(Object(y.j)(e,"RenderListFormData")?e.RenderListFormData:e)})},t.prototype.reserveListItemId=function(){return this.clone(t,"reservelistitemid").postCore().then(function(e){return Object(y.j)(e,"ReserveListItemId")?e.ReserveListItemId:e})},t.prototype.getListItemEntityTypeFullName=function(){return this.clone(t,null,!1).select("ListItemEntityTypeFullName").get().then(function(e){return e.ListItemEntityTypeFullName})},t.prototype.addValidateUpdateItemUsingPath=function(e,n,r,o){return void 0===r&&(r=!1),this.clone(t,"AddValidateUpdateItemUsingPath()").postCore({body:Object(y.n)({bNewDocumentUpdate:r,checkInComment:o,formValues:e,listItemCreateInfo:{FolderPath:{DecodedUrl:n,__metadata:{type:"SP.ResourcePath"}},__metadata:{type:"SP.ListItemCreationInformationUsingPath"}}})}).then(function(e){return void 0!==e.AddValidateUpdateItemUsingPath?e.AddValidateUpdateItemUsingPath.results:e})},t.prototype.getSiteScript=function(){return i(this,void 0,void 0,function(){var e,n;return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t).rootFolder.select("ServerRelativeUrl").get()];case 1:return e=r.sent(),[4,p(e.ServerRelativeUrl)];case 2:return n=r.sent(),[2,new S.a(this,"").getSiteScriptFromList(n)]}})})},t}(de),We=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e){var t=this;"string"==typeof e&&(e={text:e});var r=Object(y.n)(Object(y.f)(d("Microsoft.SharePoint.Comments.comment"),e));return this.clone(n,null).postCore({body:r}).then(function(e){return Object(y.f)(t.getById(e.id),e)})},t.prototype.getById=function(e){var t=new Ke(this);return t.concat("("+e+")"),t},t.prototype.clear=function(){return this.clone(n,"DeleteAll").postCore()};var n;return t=n=o([h("comments")],t)}(j),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"replies",{get:function(){return new Ve(this)},enumerable:!0,configurable:!0}),t.prototype.like=function(){return this.clone(t,"Like").postCore()},t.prototype.unlike=function(){return this.clone(t,"Unlike").postCore()},t.prototype.delete=function(){return this.deleteCore()},t}(R),Ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e){"string"==typeof e&&(e={text:e});var t=Object(y.n)(Object(y.f)(d("Microsoft.SharePoint.Comments.comment"),e));return this.clone(n,null).postCore({body:t}).then(function(e){return Object(y.f)(new Ke(u(e)),e)})};var n;return t=n=o([h("replies")],t)}(j),Qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){var t=new ze(this);return t.concat("("+e+")"),t},t.prototype.getItemByStringId=function(e){return new ze(this.parentUrl,"getItemByStringId('"+e+"')")},t.prototype.skip=function(e,t){return void 0===t&&(t=!1),t?this.query.set("$skiptoken",encodeURIComponent("Paged=TRUE&PagedPrev=TRUE&p_ID="+e)):this.query.set("$skiptoken",encodeURIComponent("Paged=TRUE&p_ID="+e)),this},t.prototype.getPaged=function(e){return void 0===e&&(e=new v.f),this.get(new $e(this,e))},t.prototype.getAll=function(e,t){void 0===e&&(e=2e3),void 0===t&&(t="application/json;odata=nometadata"),b.a.write("Calling items.getAll should be done sparingly. Ensure this is the correct choice. If you are unsure, it is not.",2);var r=new n(this,"").top(e).configure({headers:{Accept:t}});return this.query.forEach(function(e,t){/^\$select|filter|top|expand$/i.test(t)&&r.query.set(t,e)}),new Promise(function(e,t){var n=[],o=function(r){[].push.apply(n,r.results),r.hasNext?r.getNext().then(o).catch(t):e(n)};r.getPaged().then(o).catch(t)})},t.prototype.add=function(e,t){var r=this;void 0===e&&(e={}),void 0===t&&(t=null);var o=this.addBatchDependency();return this.ensureListItemEntityTypeName(t).then(function(t){var i=Object(y.n)(Object(y.f)(d(t),e)),a=r.clone(n,"").postCore({body:i}).then(function(e){return{data:e,item:r.getById(e.Id)}});return o(),a})},t.prototype.ensureListItemEntityTypeName=function(e){return e?Promise.resolve(e):this.getParent(He).getListItemEntityTypeFullName()};var n;return t=n=o([h("items")],t)}(j),ze=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._deleteWithETag,t}return r(t,e),Object.defineProperty(t.prototype,"attachmentFiles",{get:function(){return new Ne(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentType",{get:function(){return new _e(this,"ContentType")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return new We(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissions",{get:function(){return new x(this,"EffectiveBasePermissions")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissionsForUI",{get:function(){return new x(this,"EffectiveBasePermissionsForUI")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesAsHTML",{get:function(){return new R(this,"FieldValuesAsHTML")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesAsText",{get:function(){return new R(this,"FieldValuesAsText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesForEdit",{get:function(){return new R(this,"FieldValuesForEdit")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folder",{get:function(){return new Ce(this,"folder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"file",{get:function(){return new tt(this,"file")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"versions",{get:function(){return new Je(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"list",{get:function(){return this.getParent(He,this.parentUrl.substr(0,this.parentUrl.lastIndexOf("/")))},enumerable:!0,configurable:!0}),t.prototype.update=function(e,t,n){var r=this;return void 0===t&&(t="*"),void 0===n&&(n=null),new Promise(function(o,i){var a=r.addBatchDependency();return r.ensureListItemEntityTypeName(n).then(function(n){var i=Object(y.n)(Object(y.f)(d(n),e));return a(),r.postCore({body:i,headers:{"IF-Match":t,"X-HTTP-Method":"MERGE"}},new Ze).then(function(e){o({data:e,item:r})})}).catch(function(e){return i(e)})})},t.prototype.getLikedBy=function(){return this.clone(t,"likedBy").postCore()},t.prototype.like=function(){return this.clone(t,"like").postCore()},t.prototype.unlike=function(){return this.clone(t,"unlike").postCore()},t.prototype.recycle=function(){return this.clone(t,"recycle").postCore()},t.prototype.getWopiFrameUrl=function(e){void 0===e&&(e=0);var n=this.clone(t,"getWOPIFrameUrl(@action)");return n.query.set("@action",e),n.postCore().then(function(e){return Object(y.j)(e,"GetWOPIFrameUrl")?e.GetWOPIFrameUrl:e})},t.prototype.validateUpdateListItem=function(e,n){return void 0===n&&(n=!1),this.clone(t,"validateupdatelistitem").postCore({body:Object(y.n)({formValues:e,bNewDocumentUpdate:n})})},t.prototype.getLikedByInformation=function(){return this.clone(t,"likedByInformation").expand("likedby").getCore()},t.prototype.ensureListItemEntityTypeName=function(e){return e?Promise.resolve(e):this.list.getListItemEntityTypeFullName()},t}(ge),Je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){var t=new Xe(this);return t.concat("("+e+")"),t},t=o([h("versions")],t)}(j),Xe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.delete=t._deleteWithETag,t}return r(t,e),t}(R),Ye=function(){function e(e,t,n,r){this.parent=e,this.nextUrl=t,this.results=n,this.innerParser=r}return Object.defineProperty(e.prototype,"hasNext",{get:function(){return"string"==typeof this.nextUrl&&this.nextUrl.length>0},enumerable:!0,configurable:!0}),e.prototype.getNext=function(){if(this.hasNext){return new Qe(this.nextUrl,null).configureFrom(this.parent).getPaged(this.innerParser)}return new Promise(function(e){return e(null)})},e}(),$e=function(e){function t(t,n){var r=e.call(this)||this;return r._parent=t,r.innerParser=n,r}return r(t,e),t.prototype.parse=function(e){var t=this;return this.innerParser.parse(e).then(function(e){return i(t,void 0,void 0,function(){var t,n;return a(this,function(r){return t=this.innerParser.rawJson,n=Object(y.j)(t,"d")&&Object(y.j)(t.d,"__next")?t.d.__next:t["odata.nextLink"],[2,new Ye(this._parent,n,e,this.innerParser)]})})})},t}(v.g),Ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.parse=function(e){return i(this,void 0,void 0,function(){var t=this;return a(this,function(n){return[2,new Promise(function(n,r){t.handleError(e,r)&&n({"odata.etag":e.headers.get("etag")})})]})})},t}(v.g),et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getByName=function(e){var t=new tt(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,t,r){var o=this;return void 0===r&&(r=!0),new n(this,"add(overwrite="+r+",url='"+e+"')").postCore({body:t}).then(function(t){return{data:t,file:o.getByName(e)}})},t.prototype.addUsingPath=function(e,t,r){var o=this;void 0===r&&(r={Overwrite:!1});var i=["AddUsingPath(decodedurl='"+e+"'"];return r&&(r.Overwrite&&i.push(",Overwrite=true"),r.AutoCheckoutOnInvalidData&&i.push(",AutoCheckoutOnInvalidData=true"),Object(y.r)(r.XorHash)||i.push(",XorHash="+r.XorHash)),i.push(")"),new n(this,i.join("")).postCore({body:t}).then(function(t){return{data:t,file:o.getByName(e)}})},t.prototype.addChunked=function(e,t,r,o,i){var a=this;return void 0===o&&(o=!0),void 0===i&&(i=10485760),this.clone(n,"add(overwrite = "+o+", url = '"+e+"')",!1).postCore().then(function(){return a.getByName(e)}).then(function(e){return e.setContentChunked(t,r,i)})},t.prototype.addTemplateFile=function(e,t){var r=this;return this.clone(n,"addTemplateFile(urloffile = '"+e+"', templatefiletype = "+t+")",!1).postCore().then(function(t){return{data:t,file:r.getByName(e)}})};var n;return t=n=o([h("files")],t)}(j),tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"listItemAllFields",{get:function(){return new R(this,"listItemAllFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"versions",{get:function(){return new nt(this)},enumerable:!0,configurable:!0}),t.prototype.approve=function(e){return void 0===e&&(e=""),this.clone(t,"approve(comment = '"+e+"')").postCore()},t.prototype.cancelUpload=function(e){return this.clone(t,"cancelUpload(uploadId = guid'"+e+"')",!1).postCore()},t.prototype.checkin=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=pe.Major),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"checkin(comment = '"+e+"', checkintype = "+n+")").postCore()},t.prototype.checkout=function(){return this.clone(t,"checkout").postCore()},t.prototype.copyTo=function(e,n){return void 0===n&&(n=!0),this.clone(t,"copyTo(strnewurl = '"+e+"', boverwrite = "+n+")").postCore()},t.prototype.delete=function(e){return void 0===e&&(e="*"),this.clone(t,null).postCore({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.deny=function(e){if(void 0===e&&(e=""),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"deny(comment = '"+e+"')").postCore()},t.prototype.getLimitedWebPartManager=function(e){return void 0===e&&(e=ot.Shared),new ve(this,"getLimitedWebPartManager(scope = "+e+")")},t.prototype.moveTo=function(e,n){return void 0===n&&(n=it.Overwrite),this.clone(t,"moveTo(newurl = '"+e+"', flags = "+n+")").postCore()},t.prototype.publish=function(e){if(void 0===e&&(e=""),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"publish(comment = '"+e+"')").postCore()},t.prototype.recycle=function(){return this.clone(t,"recycle").postCore()},t.prototype.undoCheckout=function(){return this.clone(t,"undoCheckout").postCore()},t.prototype.unpublish=function(e){if(void 0===e&&(e=""),e.length>1023)throw Error("The maximum comment length is 1023 characters.");return this.clone(t,"unpublish(comment = '"+e+"')").postCore()},t.prototype.getText=function(){return this.clone(t,"$value",!1).get(new v.i,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBlob=function(){return this.clone(t,"$value",!1).get(new v.a,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBuffer=function(){return this.clone(t,"$value",!1).get(new v.b,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getJSON=function(){return this.clone(t,"$value",!1).get(new v.d,{headers:{binaryStringResponseBody:"true"}})},t.prototype.setContent=function(e){var n=this;return this.clone(t,"$value",!1).postCore({body:e,headers:{"X-HTTP-Method":"PUT"}}).then(function(e){return new t(n)})},t.prototype.getItem=function(){for(var e=this,t=[],n=0;n0?"tenantappcatalog":"sitecollectionappcatalog";return new t(s(this.toUrl()),"_api/web/"+o+"/add(overwrite="+r+",url='"+e+"')").postCore({body:n}).then(function(e){return{data:e,file:new tt(u(e))}})},t}(j),ct=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.deploy=function(e){return void 0===e&&(e=!1),this.clone(t,"Deploy("+e+")").postCore()},t.prototype.retract=function(){return this.clone(t,"Retract").postCore()},t.prototype.install=function(){return this.clone(t,"Install").postCore()},t.prototype.uninstall=function(){return this.clone(t,"Uninstall").postCore()},t.prototype.upgrade=function(){return this.clone(t,"Upgrade").postCore()},t.prototype.remove=function(){return this.clone(t,"Remove").postCore()},t}(R),lt=function(e){function t(t){var n=e.call(this)||this;return n.baseUrl=t,n}return r(t,e),t.ParseResponse=function(e){return new Promise(function(t,n){for(var r,o,i=[],a=new RegExp("^HTTP/[0-9.]+ +([0-9]+) +(.*)","i"),s=e.split("\n"),u="batch",c=0;c0&&(o.push("--changeset_"+i+"--\n\n"),i=""),o.push("--batch_"+e.batchId+"\n")):(i.length<1&&(i=Object(y.h)(),o.push("--batch_"+e.batchId+"\n"),o.push('Content-Type: multipart/mixed; boundary="changeset_'+i+'"\n\n')),o.push("--changeset_"+i+"\n")),o.push("Content-Type: application/http\n"),o.push("Content-Transfer-Encoding: binary\n\n");var u=new Headers,c=Object(y.m)(s.url)?s.url:Object(y.d)(r,s.url);if(b.a.write("["+e.batchId+"] ("+(new Date).getTime()+") Adding request "+s.method+" "+c+" to batch.",0),"GET"!==s.method){var l=s.method,p=s.options.headers;Object(y.j)(s,"options")&&Object(y.j)(s.options,"headers")&&void 0!==p["X-HTTP-Method"]&&(l=p["X-HTTP-Method"],delete p["X-HTTP-Method"]),o.push(l+" "+c+" HTTP/1.1\n"),u.set("Content-Type","application/json;odata=verbose;charset=utf-8")}else o.push(s.method+" "+c+" HTTP/1.1\n");Object(y.o)(u,C.headers),s.options&&Object(y.o)(u,s.options.headers),u.has("Accept")||u.append("Accept","application/json"),u.has("Content-Type")||u.append("Content-Type","application/json;odata=verbose;charset=utf-8"),u.has("X-ClientService-ClientTag")||u.append("X-ClientService-ClientTag","PnPCoreJS:@pnp-1.3.11"),u.forEach(function(e,t){o.push(t+": "+e+"\n")}),o.push("\n"),s.options.body&&o.push(s.options.body+"\n\n")}i.length>0&&(o.push("--changeset_"+i+"--\n\n"),i=""),o.push("--batch_"+e.batchId+"--\n");var d={body:o.join(""),headers:{"Content-Type":"multipart/mixed; boundary=batch_"+e.batchId},method:"POST"};return b.a.write("["+e.batchId+"] ("+(new Date).getTime()+") Sending batch request.",1),n.fetch(Object(y.d)(r,"/_api/$batch"),d).then(function(e){return e.text()}).then(t.ParseResponse).then(function(t){if(t.length!==e.requests.length)throw Error("Could not properly parse responses to match requests in batch.");return b.a.write("["+e.batchId+"] ("+(new Date).getTime()+") Resolving batched requests.",1),t.reduce(function(t,n,r){var o=e.requests[r];return b.a.write("["+o.id+"] ("+(new Date).getTime()+") Resolving request in batch "+e.batchId+".",1),t.then(function(e){return o.parser.parse(n).then(o.resolve).catch(o.reject)})},Promise.resolve())})})},t}(v.e),pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e,t){var r=this;return void 0===t&&(t=!1),this.clone(n,"add").postCore({body:Object(y.n)({featdefScope:0,featureId:e,force:t})}).then(function(t){return{data:t,feature:r.getById(e)}})},t.prototype.getById=function(e){var t=new dt(this);return t.concat("('"+e+"')"),t},t.prototype.remove=function(e,t){return void 0===t&&(t=!1),this.clone(n,"remove").postCore({body:Object(y.n)({featureId:e,force:t})})};var n;return t=n=o([h("features")],t)}(j),dt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.deactivate=function(e){var n=this;void 0===e&&(e=!1);var r=this.addBatchDependency();return new t(this).select("DefinitionId").get().then(function(t){var o=n.getParent(pt,n.parentUrl,"",n.batch).remove(t.DefinitionId,e);return r(),o})},t}(R),ht=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,Object.defineProperty(t.prototype,"rootWeb",{get:function(){return new It(this,"rootweb")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"features",{get:function(){return new pt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new Be(this)},enumerable:!0,configurable:!0}),t.prototype.getRootWeb=function(){return this.rootWeb.select("Url").get().then(function(e){return new It(e.Url)})},t.prototype.getContextInfo=function(){return new n(this.parentUrl,"_api/contextinfo").postCore().then(function(e){if(Object(y.j)(e,"GetContextWebInformation")){var t=e.GetContextWebInformation;return t.SupportedSchemaVersions=t.SupportedSchemaVersions.results,t}return e})},t.prototype.getDocumentLibraries=function(e){var t=new x("","_api/sp.web.getdocumentlibraries(@v)");return t.query.set("@v","'"+e+"'"),t.get().then(function(e){return Object(y.j)(e,"GetDocumentLibraries")?e.GetDocumentLibraries:e})},t.prototype.getWebUrlFromPageUrl=function(e){var t=new x("","_api/sp.web.getweburlfrompageurl(@v)");return t.query.set("@v","'"+e+"'"),t.get().then(function(e){return Object(y.j)(e,"GetWebUrlFromPageUrl")?e.GetWebUrlFromPageUrl:e})},t.prototype.getChanges=function(e){var t=Object(y.n)({query:Object(y.f)({__metadata:{type:"SP.ChangeQuery"}},e)});return this.clone(n,"getchanges").postCore({body:t})},t.prototype.delete=function(){return i(this,void 0,void 0,function(){var e,t;return a(this,function(r){switch(r.label){case 0:return[4,this.clone(n,"").select("Id").get()];case 1:return e=r.sent(),t=new n(this.parentUrl,"_api/SPSiteManager/Delete"),[4,t.postCore({body:Object(y.n)({siteId:e.Id})})];case 2:return r.sent(),[2]}})})},t.prototype.createBatch=function(){return new lt(this.parentUrl)},t.prototype.openWebById=function(e){return this.clone(n,"openWebById('"+e+"')").postCore().then(function(e){return{data:e,web:It.fromUrl(e["odata.id"]||e.__metadata.uri)}})},t.prototype.joinHubSite=function(e){return this.clone(n,"joinHubSite('"+e+"')").postCore()},t.prototype.registerHubSite=function(){return this.clone(n,"registerHubSite").postCore()},t.prototype.unRegisterHubSite=function(){return this.clone(n,"unRegisterHubSite").postCore()},t.prototype.createCommunicationSite=function(e,t,n,r,o,s,u,c,l){var p=this;void 0===t&&(t=1033),void 0===n&&(n=!1),void 0===o&&(o=""),void 0===s&&(s=""),void 0===u&&(u="00000000-0000-0000-0000-000000000000"),void 0===c&&(c="00000000-0000-0000-0000-000000000000");var d={Classification:s,Description:o,HubSiteId:c,Lcid:t,Owner:l,ShareByEmailEnabled:n,SiteDesignId:u,Title:e,Url:r,WebTemplate:"SITEPAGEPUBLISHING#0",WebTemplateExtensionId:"00000000-0000-0000-0000-000000000000"},h=Object(y.n)({request:Object(y.f)({__metadata:{type:"Microsoft.SharePoint.Portal.SPSiteCreationRequest"}},d)});return this.getRootWeb().then(function(e){return i(p,void 0,void 0,function(){var t,n;return a(this,function(r){return t=new E,n=e.parentUrl+"/_api/SPSiteManager/Create",[2,t.post(n,{body:h,headers:{Accept:"application/json;odata=verbose","Content-Type":"application/json;odata=verbose;charset=utf-8"}}).then(function(e){return e.json()}).then(function(e){if(Object(y.j)(e,"error"))throw e;return Object(y.j)(e,"d")&&Object(y.j)(e.d,"Create")?e.d.Create:e})]})})})},t.prototype.createModernTeamSite=function(e,t,n,r,o,s,u,c,l){var p=this;void 0===n&&(n=!0),void 0===r&&(r=1033),void 0===o&&(o=""),void 0===s&&(s=""),void 0===c&&(c="00000000-0000-0000-0000-000000000000");var d={alias:t,displayName:e,isPublic:n,optionalParams:{Classification:s,CreationOptions:{results:["SPSiteLanguage:"+r,"HubSiteId:"+c]},Description:o,Owners:{results:u||[]}}};return l&&d.optionalParams.CreationOptions.results.push("implicit_formula_292aa8a00786498a87a5ca52d9f4214a_"+l),this.getRootWeb().then(function(e){return i(p,void 0,void 0,function(){var t,n;return a(this,function(r){return t=new E,n=e.parentUrl+"/_api/GroupSiteManager/CreateGroupEx",[2,t.post(n,{body:Object(y.n)(d),headers:{Accept:"application/json;odata=verbose","Content-Type":"application/json;odata=verbose;charset=utf-8"}}).then(function(e){return e.json()})]})})})};var n;return t=n=o([h("_api/site")],t)}(R),ft=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){var t=new gt(this);return t.concat("("+e+")"),t},t.prototype.add=function(e,n,r){var o=this;void 0===r&&(r=!0);var i=Object(y.n)(Object(y.f)(d("SP.NavigationNode"),{IsVisible:r,Title:e,Url:n}));return this.clone(t,null).postCore({body:i}).then(function(e){return{data:e,node:o.getById(e.Id)}})},t.prototype.moveAfter=function(e,n){var r=Object(y.n)({nodeId:e,previousNodeId:n});return this.clone(t,"MoveAfter").postCore({body:r})},t}(j),gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return new ft(this,"Children")},enumerable:!0,configurable:!0}),t.prototype.delete=function(){return e.prototype.deleteCore.call(this)},t.prototype.update=function(e){var t=this,n=Object(y.n)(Object(y.f)({__metadata:{type:"SP.NavigationNode"}},e));return this.postCore({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,node:t}})},t}(R),mt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"quicklaunch",{get:function(){return new ft(this,"quicklaunch")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topNavigationBar",{get:function(){return new ft(this,"topnavigationbar")},enumerable:!0,configurable:!0}),t=o([h("navigation")],t)}(x),yt=function(e){function t(t,n){return void 0===n&&(n=null),e.call(this,t,n)||this}return r(t,e),t.prototype.getMenuState=function(e,n,r,o){return void 0===e&&(e=null),void 0===n&&(n=10),void 0===r&&(r=null),void 0===o&&(o=null),new t(this,"_api/navigation/MenuState").postCore({body:Object(y.n)({customProperties:o,depth:n,mapProviderName:r,menuNodeKey:e})})},t.prototype.getMenuNodeKey=function(e,n){return void 0===n&&(n=null),new t(this,"_api/navigation/MenuNodeKey").postCore({body:Object(y.n)({currentUrl:e,mapProviderName:n})})},t}(x),bt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.FromUrl=function(e){if(null===e)return new n("");var t=e.indexOf("_api/");return new n(t>-1?e.substr(0,t):e)},t.prototype.getRelatedItems=function(e,t){var r=this.clone(n,null);return r.concat(".GetRelatedItems"),r.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e})})},t.prototype.getPageOneRelatedItems=function(e,t){var r=this.clone(n,null);return r.concat(".GetPageOneRelatedItems"),r.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e})})},t.prototype.addSingleLink=function(e,t,r,o,i,a,s){void 0===s&&(s=!1);var u=this.clone(n,null);return u.concat(".AddSingleLink"),u.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e,SourceWebUrl:r,TargetItemID:i,TargetListName:o,TargetWebUrl:a,TryAddReverseLink:s})})},t.prototype.addSingleLinkToUrl=function(e,t,r,o){void 0===o&&(o=!1);var i=this.clone(n,null);return i.concat(".AddSingleLinkToUrl"),i.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e,TargetItemUrl:r,TryAddReverseLink:o})})},t.prototype.addSingleLinkFromUrl=function(e,t,r,o){void 0===o&&(o=!1);var i=this.clone(n,null);return i.concat(".AddSingleLinkFromUrl"),i.postCore({body:Object(y.n)({SourceItemUrl:e,TargetItemID:r,TargetListName:t,TryAddReverseLink:o})})},t.prototype.deleteSingleLink=function(e,t,r,o,i,a,s){void 0===s&&(s=!1);var u=this.clone(n,null);return u.concat(".DeleteSingleLink"),u.postCore({body:Object(y.n)({SourceItemID:t,SourceListName:e,SourceWebUrl:r,TargetItemID:i,TargetListName:o,TargetWebUrl:a,TryDeleteReverseLink:s})})};var n;return t=n=o([h("_api/SP.RelatedItemManager")],t)}(x),vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"installedLanguages",{get:function(){return new St(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"globalInstalledLanguages",{get:function(){return new St(this,"globalinstalledlanguages")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeZone",{get:function(){return new Tt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeZones",{get:function(){return new Ot(this)},enumerable:!0,configurable:!0}),t=o([h("regionalsettings")],t)}(R),St=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("installedlanguages")],t)}(j),Tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.utcToLocalTime=function(e){var t;return t="string"==typeof e?e:e.toISOString(),this.clone(n,"utctolocaltime('"+t+"')").postCore().then(function(e){return Object(y.j)(e,"UTCToLocalTime")?e.UTCToLocalTime:e})},t.prototype.localTimeToUTC=function(e){var t;return t="string"==typeof e?e:Object(y.e)(e,"minute",-1*e.getTimezoneOffset()).toISOString(),this.clone(n,"localtimetoutc('"+t+"')").postCore().then(function(e){return Object(y.j)(e,"LocalTimeToUTC")?e.LocalTimeToUTC:e})};var n;return t=n=o([h("timezone")],t)}(R),Ot=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.getById=function(e){return this.clone(n,"GetById("+e+")").postCore({},c(Tt))};var n;return t=n=o([h("timezones")],t)}(j),wt=function(e){function t(n,r){return e.call(this,t.getBaseUrl(n),"_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility."+r)||this}return r(t,e),t.getBaseUrl=function(e){if("string"==typeof e)return e;var t=e,n=t.toUrl(),r=n.indexOf("_api/");return r<0?n:n.substr(0,r)},t.prototype.execute=function(e){return this.postCore({body:JSON.stringify(e),headers:{"Content-Type":"application/json;charset=utf-8"}})},t.prototype.createSiteDesign=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"CreateSiteDesign").execute({info:e})];case 1:return[2,n.sent()]}})})},t.prototype.applySiteDesign=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"ApplySiteDesign").execute({siteDesignId:e,webUrl:n})];case 1:return[2,r.sent()]}})})},t.prototype.getSiteDesigns=function(){return i(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.clone(t,"GetSiteDesigns").execute({})];case 1:return[2,e.sent()]}})})},t.prototype.getSiteDesignMetadata=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteDesignMetadata").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.updateSiteDesign=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"UpdateSiteDesign").execute({updateInfo:e})];case 1:return[2,n.sent()]}})})},t.prototype.deleteSiteDesign=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"DeleteSiteDesign").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.getSiteDesignRights=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteDesignRights").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.grantSiteDesignRights=function(e,n,r){return void 0===r&&(r=1),i(this,void 0,void 0,function(){return a(this,function(o){switch(o.label){case 0:return[4,this.clone(t,"GrantSiteDesignRights").execute({grantedRights:r.toString(),id:e,principalNames:n})];case 1:return[2,o.sent()]}})})},t.prototype.revokeSiteDesignRights=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"RevokeSiteDesignRights").execute({id:e,principalNames:n})];case 1:return[2,r.sent()]}})})},t.prototype.addSiteDesignTask=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"AddSiteDesignTask").execute({webUrl:e,siteDesignId:n})];case 1:return[2,r.sent()]}})})},t.prototype.addSiteDesignTaskToCurrentWeb=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"AddSiteDesignTaskToCurrentWeb").execute({siteDesignId:e})];case 1:return[2,n.sent()]}})})},t.prototype.getSiteDesignTask=function(e){return i(this,void 0,void 0,function(){var n;return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"GetSiteDesignTask").execute({taskId:e})];case 1:return n=r.sent(),[2,Object(y.j)(n,"ID")?n:null]}})})},t.prototype.getSiteDesignRun=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"GetSiteDesignRun").execute({webUrl:e,siteDesignId:n})];case 1:return[2,r.sent()]}})})},t.prototype.getSiteDesignRunStatus=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"GetSiteDesignRunStatus").execute({webUrl:e,runId:n})];case 1:return[2,r.sent()]}})})},t}(x),Ct=function(e){function t(n,r){return e.call(this,t.getBaseUrl(n),"_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility."+r)||this}return r(t,e),t.getBaseUrl=function(e){if("string"==typeof e)return e;var t=e,n=t.toUrl(),r=n.indexOf("_api/");return r<0?n:n.substr(0,r)},t.prototype.execute=function(e){return this.postCore({body:JSON.stringify(e)})},t.prototype.getSiteScripts=function(){return this.clone(t,"GetSiteScripts",!0).execute({})},t.prototype.createSiteScript=function(e,n,r){return i(this,void 0,void 0,function(){return a(this,function(o){switch(o.label){case 0:return[4,this.clone(t,"CreateSiteScript(Title=@title,Description=@desc)?@title='"+encodeURIComponent(e)+"'&@desc='"+encodeURIComponent(n)+"'").execute(r)];case 1:return[2,o.sent()]}})})},t.prototype.getSiteScriptMetadata=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteScriptMetadata").execute({id:e})];case 1:return[2,n.sent()]}})})},t.prototype.deleteSiteScript=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"DeleteSiteScript").execute({id:e})];case 1:return n.sent(),[2]}})})},t.prototype.updateSiteScript=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return n&&(e.Content=JSON.stringify(n)),[4,this.clone(t,"UpdateSiteScript").execute({updateInfo:e})];case 1:return[2,r.sent()]}})})},t.prototype.getSiteScriptFromList=function(e){return i(this,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return[4,this.clone(t,"GetSiteScriptFromList").execute({listUrl:e})];case 1:return[2,n.sent()]}})})},t.prototype.getSiteScriptFromWeb=function(e,n){return i(this,void 0,void 0,function(){return a(this,function(r){switch(r.label){case 0:return[4,this.clone(t,"getSiteScriptFromWeb").execute({webUrl:e,info:n})];case 1:return[2,r.sent()]}})})},t}(x),Pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.prototype.add=function(e,t,r,o,i,a){void 0===r&&(r=""),void 0===o&&(o="STS"),void 0===i&&(i=1033),void 0===a&&(a=!0);var s={Description:r,Language:i,Title:e,Url:t,UseSamePermissionsAsParentSite:a,WebTemplate:o},c=Object(y.n)({parameters:Object(y.f)({__metadata:{type:"SP.WebCreationInformation"}},s)});return this.clone(n,"add").postCore({body:c}).then(function(e){return{data:e,web:new It(u(e).replace(/_api\/web\/?/i,""))}})};var n;return t=n=o([h("webs")],t)}(j),_t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t=o([h("webinfos")],t)}(j),It=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e),n=t,t.fromUrl=function(e,t){return new n(s(e),t)},Object.defineProperty(t.prototype,"webs",{get:function(){return new Pt(this)},enumerable:!0,configurable:!0}),t.prototype.getParentWeb=function(){var e=this;return this.select("ParentWeb/Id").expand("ParentWeb").get().then(function(t){var n=t.ParentWeb;return n?new ht(e.parentUrl).openWebById(n.Id):null})},t.prototype.getSubwebsFilteredForCurrentUser=function(e,t){return void 0===e&&(e=-1),void 0===t&&(t=-1),this.clone(Pt,"getSubwebsFilteredForCurrentUser(nWebTemplateFilter="+e+",nConfigurationFilter="+t+")")},Object.defineProperty(t.prototype,"allProperties",{get:function(){return this.clone(R,"allproperties")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"webinfos",{get:function(){return new _t(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentTypes",{get:function(){return new Pe(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lists",{get:function(){return new qe(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fields",{get:function(){return new Ue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"features",{get:function(){return new pt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"availablefields",{get:function(){return new Ue(this,"availablefields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"navigation",{get:function(){return new mt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteUsers",{get:function(){return new A(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteGroups",{get:function(){return new M(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteUserInfoList",{get:function(){return new He(this,"siteuserinfolist")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"regionalSettings",{get:function(){return new vt(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){return new L(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folders",{get:function(){return new we(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new Be(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"roleDefinitions",{get:function(){return new q(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relatedItems",{get:function(){return bt.FromUrl(this.toUrl())},enumerable:!0,configurable:!0}),t.prototype.createBatch=function(){return new lt(this.parentUrl)},Object.defineProperty(t.prototype,"rootFolder",{get:function(){return new Ce(this,"rootFolder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedOwnerGroup",{get:function(){return new F(this,"associatedownergroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedMemberGroup",{get:function(){return new F(this,"associatedmembergroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedVisitorGroup",{get:function(){return new F(this,"associatedvisitorgroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultDocumentLibrary",{get:function(){return new He(this,"DefaultDocumentLibrary")},enumerable:!0,configurable:!0}),t.prototype.getFolderById=function(e){return new Ce(this,"getFolderById('"+e+"')")},t.prototype.getFolderByServerRelativeUrl=function(e){return new Ce(this,"getFolderByServerRelativeUrl('"+e+"')")},t.prototype.getFolderByServerRelativePath=function(e){return new Ce(this,"getFolderByServerRelativePath(decodedUrl='"+e+"')")},t.prototype.getFileById=function(e){return new tt(this,"getFileById('"+e+"')")},t.prototype.getFileByServerRelativeUrl=function(e){return new tt(this,"getFileByServerRelativeUrl('"+e+"')")},t.prototype.getFileByServerRelativePath=function(e){return new tt(this,"getFileByServerRelativePath(decodedUrl='"+e+"')")},t.prototype.getList=function(e){return new He(this,"getList('"+e+"')")},t.prototype.update=function(e){var t=this,n=Object(y.n)(Object(y.f)({__metadata:{type:"SP.Web"}},e));return this.postCore({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,web:t}})},t.prototype.delete=function(){return e.prototype.deleteCore.call(this)},t.prototype.applyTheme=function(e,t,r,o){var i=Object(y.n)({backgroundImageUrl:r,colorPaletteUrl:e,fontSchemeUrl:t,shareGenerated:o});return this.clone(n,"applytheme").postCore({body:i})},t.prototype.applyWebTemplate=function(e){var t=this.clone(n,"applywebtemplate");return t.concat("(@t)"),t.query.set("@t",e),t.postCore()},t.prototype.ensureUser=function(e){var t=Object(y.n)({logonName:e});return this.clone(n,"ensureuser").postCore({body:t}).then(function(e){return{data:e,user:new k(u(e))}})},t.prototype.availableWebTemplates=function(e,t){return void 0===e&&(e=1033),void 0===t&&(t=!0),new j(this,"getavailablewebtemplates(lcid="+e+", doincludecrosslanguage="+t+")")},t.prototype.getCatalog=function(e){return this.clone(n,"getcatalog("+e+")").select("Id").get().then(function(e){return new He(u(e))})},t.prototype.getChanges=function(e){var t=Object(y.n)({query:Object(y.f)({__metadata:{type:"SP.ChangeQuery"}},e)});return this.clone(n,"getchanges").postCore({body:t})},Object.defineProperty(t.prototype,"customListTemplate",{get:function(){return new j(this,"getcustomlisttemplates")},enumerable:!0,configurable:!0}),t.prototype.getUserById=function(e){return new k(this,"getUserById("+e+")")},t.prototype.mapToIcon=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=""),this.clone(n,"maptoicon(filename='"+e+"', progid='"+r+"', size="+t+")").get()},t.prototype.getStorageEntity=function(e){return this.clone(n,"getStorageEntity('"+e+"')").get()},t.prototype.setStorageEntity=function(e,t,r,o){return void 0===r&&(r=""),void 0===o&&(o=""),this.clone(n,"setStorageEntity").postCore({body:Object(y.n)({comments:o,description:r,key:e,value:t})})},t.prototype.removeStorageEntity=function(e){return this.clone(n,"removeStorageEntity('"+e+"')").postCore()},t.prototype.getAppCatalog=function(e){return new ut(e||this)},t.prototype.getSiteCollectionAppCatalog=function(e){return new ut(e||this,"_api/web/sitecollectionappcatalog/AvailableApps")},t.prototype.getClientSideWebParts=function(){return this.clone(j,"GetClientSideWebParts").get()},t.prototype.addClientSidePage=function(e,t){return void 0===t&&(t=e.replace(/\.[^\/.]+$/,"")),Nt.create(this,e,t)},t.prototype.addClientSidePageByPath=function(e,t){return void 0===t&&(t=e.replace(/\.[^\/.]+$/,"")),Nt.create(this,e,t)},t.prototype.createDefaultAssociatedGroups=function(e,t,r){var o=this.clone(n,"createDefaultAssociatedGroups(userLogin=@u,userLogin2=@v,groupNameSeed=@s)");return o.query.set("@u","'"+encodeURIComponent(e||"")+"'"),o.query.set("@v","'"+encodeURIComponent(t||"")+"'"),o.query.set("@s","'"+encodeURIComponent(r||"")+"'"),o.postCore()},t.prototype.hubSiteData=function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,function(){return a(this,function(t){return[2,this.clone(n,"hubSiteData("+e+")").get().then(function(e){return JSON.parse(e)})]})})},t.prototype.syncHubSiteTheme=function(){return this.clone(n,"syncHubSiteTheme").postCore()},t.prototype.getSiteDesignRuns=function(e){return new wt(this,"").getSiteDesignRun(void 0,e)},t.prototype.getSiteScript=function(e){return new Ct(this,"").getSiteScriptFromWeb(void 0,e)},t.prototype.addSiteDesignTask=function(e){return new wt(this,"").addSiteDesignTaskToCurrentWeb(e)},t.prototype.getSiteDesignRunStatus=function(e){return new wt(this,"").getSiteDesignRunStatus(void 0,e)};var n;return t=n=o([h("_api/web")],t)}(fe);!function(e){e[e.NotPromoted=0]="NotPromoted",e[e.PromoteOnPublish=1]="PromoteOnPublish",e[e.Promoted=2]="Promoted"}(st||(st={}));var Et,Nt=function(e){function t(n,r,o,i,a,u){void 0===i&&(i=!1),void 0===a&&(a=[]),void 0===u&&(u=!1);var c=e.call(this,n,r)||this;return c.json=o,c.sections=a,c.commentsDisabled=u,c._bannerImageDirty=!1,"string"==typeof n?(c._parentUrl="",c._url=Object(y.d)(s(n),r)):c.extend(t.initFrom(n,null),r),c._pageSettings={controlType:0,pageSettingsSlice:{isDefaultDescription:!0,isDefaultThumbnail:!0}},c._layoutPart=t.getDefaultLayoutPart(),void 0===o||i||c.fromJSON(o),c}return r(t,e),t.create=function(e,n,r,o,s){return void 0===o&&(o="Article"),void 0===s&&(s=0),i(this,void 0,void 0,function(){var i,u;return a(this,function(a){switch(a.label){case 0:return n=n.replace(/\.aspx$/i,""),[4,t.initFrom(e,"_api/sitepages/pages").postCore({body:Object(y.n)(Object.assign(d("SP.Publishing.SitePage"),{PageLayoutType:o,PromotedState:s}))})];case 1:return i=a.sent(),u=new t(e,"",i),u.title=n,[4,u.save(!1)];case 2:return a.sent(),u.title=r,[2,u]}})})},t.fromFile=function(e){return e.getItem().then(function(n){return new t(s(e.toUrl()),"",{Id:n.Id},!0).configureFrom(e).load()})},t.getDefaultLayoutPart=function(){return{dataVersion:"1.4",description:"Title Region Description",id:"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788",instanceId:"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788",properties:{authors:[],layoutType:"FullWidthImage",showPublishDate:!1,showTopicHeader:!1,textAlignment:"Left",title:"",topicHeader:""},serverProcessedContent:{htmlStrings:{},searchablePlainTexts:{},imageSources:{},links:{}},title:"Title area"}},t.initFrom=function(e,n){return new t(s(e.toUrl()),n).configureFrom(e)},Object.defineProperty(t.prototype,"pageLayout",{get:function(){return this.json.PageLayoutType},set:function(e){this.json.PageLayoutType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bannerImageUrl",{get:function(){return this.json.BannerImageUrl},set:function(e){this.json.BannerImageUrl=e,this._bannerImageDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bannerImageSourceType",{get:function(){return this._layoutPart.properties.imageSourceType},set:function(e){this._layoutPart.properties.imageSourceType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topicHeader",{get:function(){return Object(y.q)(this.json.TopicHeader)?this.json.TopicHeader:""},set:function(e){this.json.TopicHeader=e,this._layoutPart.properties.topicHeader=e,Object(y.r)(e)&&(this.showTopicHeader=!1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._layoutPart.properties.title},set:function(e){this.json.Title=e,this._layoutPart.properties.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layoutType",{get:function(){return this._layoutPart.properties.layoutType},set:function(e){this._layoutPart.properties.layoutType=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerTextAlignment",{get:function(){return this._layoutPart.properties.textAlignment},set:function(e){this._layoutPart.properties.textAlignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showTopicHeader",{get:function(){return this._layoutPart.properties.showTopicHeader},set:function(e){this._layoutPart.properties.showTopicHeader=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showPublishDate",{get:function(){return this._layoutPart.properties.showPublishDate},set:function(e){this._layoutPart.properties.showPublishDate=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasVerticalSection",{get:function(){return this.sections.findIndex(function(e){return 2===e.layoutIndex})>-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"verticalSection",{get:function(){return this.hasVerticalSection?this.addVerticalSection():null},enumerable:!0,configurable:!0}),t.prototype.addSection=function(){var e=new xt(this,f(this.sections),1);return this.sections.push(e),e},t.prototype.addVerticalSection=function(){var e=this.sections.findIndex(function(e){return 2===e.layoutIndex});if(e>-1)return this.sections[e];var t=new xt(this,f(this.sections),2);return this.sections.push(t),t},t.prototype.fromJSON=function(e){this.json=e;var t=JSON.parse(e.CanvasContent1),n=JSON.parse(e.LayoutWebpartsContent);return n&&n.length>0&&(this._layoutPart=n[0]),this.setControls(t),this},t.prototype.load=function(){var e=this;return this.getItem("Id","CommentsDisabled").then(function(t){return new x(e,"_api/sitepages/pages("+t.Id+")").get().then(function(n){return e.commentsDisabled=t.CommentsDisabled,e.fromJSON(n)})})},t.prototype.save=function(e){var n=this;if(void 0===e&&(e=!0),null===this.json.Id)throw Error("The id for this page is null. If you want to create a new page, please use ClientSidePage.Create");var r=Promise.resolve({});return this._bannerImageDirty&&(r=r.then(function(e){return new Promise(function(e,t){var r=n.json.BannerImageUrl;Object(y.m)(r)&&(r=r.replace(/^https?:\/\/[a-z0-9\.]*?\.[a-z]{2,3}\//i,"/"));var o=new ht(s(n.toUrl())),i=new It(s(n.toUrl())),a=i.getFileByServerRelativePath(r),u="",c="",l="",p="",d="";Promise.all([o.select("Id","Url").get().then(function(e){return u=e.Id}),i.select("Id","Url").get().then(function(e){c=e.Id,d=e.Url}),a.listItemAllFields.select("UniqueId","ParentList/Id").expand("ParentList").get().then(function(e){l=e.UniqueId,p=e.ParentList.Id})]).then(function(){var t=new x(d,"_layouts/15/getpreview.ashx");t.query.set("guidSite",""+u),t.query.set("guidWeb",""+c),t.query.set("guidFile",""+l),n.bannerImageUrl=t.toUrlAndQuery(),Object(y.q)(n._layoutPart.serverProcessedContent)||(n._layoutPart.serverProcessedContent={}),n._layoutPart.serverProcessedContent.imageSources={imageSource:r},Object(y.q)(n._layoutPart.serverProcessedContent.customMetadata)||(n._layoutPart.serverProcessedContent.customMetadata={}),n._layoutPart.serverProcessedContent.customMetadata.imageSource={listId:p,siteId:u,uniqueId:l,webId:c},n._layoutPart.properties.webId=c,n._layoutPart.properties.siteId=u,n._layoutPart.properties.listId=p,n._layoutPart.properties.uniqueId=l,e()}).catch(t)})})),this.json.IsPageCheckedOutToCurrentUser||(r=r.then(function(e){return t.initFrom(n,"_api/sitepages/pages("+n.json.Id+")/checkoutpage").postCore()})),r=r.then(function(e){var r=Object.assign(d("SP.Publishing.SitePage"),{AuthorByline:n.json.AuthorByline||[],BannerImageUrl:n.bannerImageUrl,CanvasContent1:n.getCanvasContent1(),LayoutWebpartsContent:n.getLayoutWebpartsContent(),Title:n.title,TopicHeader:n.topicHeader}),o=t.initFrom(n,"_api/sitepages/pages("+n.json.Id+")/savepage");return o.configure({headers:{"if-match":"*"}}),o.postCore({body:Object(y.n)(r)})}),e&&(r=r.then(function(e){return t.initFrom(n,"_api/sitepages/pages("+n.json.Id+")/publish").postCore()}).then(function(e){e&&(n.json.IsPageCheckedOutToCurrentUser=!1)})),r=r.then(function(e){n._bannerImageDirty=!1})},t.prototype.discardPageCheckout=function(){return i(this,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:if(null===this.json.Id)throw Error("The id for this page is null. If you want to create a new page, please use ClientSidePage.Create");return[4,t.initFrom(this,"_api/sitepages/pages("+this.json.Id+")/discardPage").postCore({body:Object(y.n)(d("SP.Publishing.SitePage"))})];case 1:return e=n.sent(),this.fromJSON(e),[2]}})})},t.prototype.promoteToNews=function(){return i(this,void 0,void 0,function(){return a(this,function(e){return[2,this.promoteNewsImpl("promoteToNews")]})})},t.prototype.enableComments=function(){var e=this;return this.setCommentsOn(!0).then(function(t){return e.commentsDisabled=!1,t})},t.prototype.disableComments=function(){var e=this;return this.setCommentsOn(!1).then(function(t){return e.commentsDisabled=!0,t})},t.prototype.findControlById=function(e){return this.findControl(function(t){return t.id===e})},t.prototype.findControl=function(e){for(var t=0;t3?{}:{zoneEmphasis:e}},t.prototype.setCommentsOn=function(e){return this.getItem().then(function(t){return new ze(t,"SetCommentsDisabled("+!e+")").update({})})},t.prototype.promoteNewsImpl=function(e){return i(this,void 0,void 0,function(){var n,r;return a(this,function(o){switch(o.label){case 0:return Object(y.r)(this.json.VersionInfo.LastVersionCreatedBy)?(n=new Date(this.json.VersionInfo.LastVersionCreated),n.getFullYear()<2e3?[4,this.save(!0)]:[3,2]):[3,2];case 1:o.sent(),o.label=2;case 2:if(null===this.json.Id)throw Error("The id for this page is null. If you want to create a new page, please use ClientSidePage.Create");return[4,t.initFrom(this,"_api/sitepages/pages("+this.json.Id+")/"+e).postCore({body:Object(y.n)(d("SP.Publishing.SitePage"))})];case 3:return r=o.sent(),[2,r]}})})},t.prototype.mergePartToTree=function(e,t){var n=null,r=12,o=0,i=0,a=1;t&&(Object(y.j)(t,"zoneIndex")&&(i=t.zoneIndex),Object(y.j)(t,"sectionIndex")&&(o=t.sectionIndex),Object(y.j)(t,"sectionFactor")&&(r=t.sectionFactor),Object(y.j)(t,"layoutIndex")&&(a=t.layoutIndex));var s=e.data&&e.data.emphasis&&e.data.emphasis.zoneEmphasis?e.data.emphasis.zoneEmphasis:0,u=this.getOrCreateSection(i,a,s),c=u.columns.filter(function(e){return e.order===o});n=c.length<1?u.addColumn(r,a):c[0],e.column=n,n.addControl(e)},t.prototype.mergeColumnToTree=function(e){var t=Object(y.j)(e.data,"position")&&Object(y.j)(e.data.position,"zoneIndex")?e.data.position.zoneIndex:0,n=Object(y.j)(e.data,"position")&&Object(y.j)(e.data.position,"layoutIndex")?e.data.position.layoutIndex:1,r=this.getOrCreateSection(t,n,e.data.emphasis.zoneEmphasis||0);e.section=r,r.columns.push(e)},t.prototype.getOrCreateSection=function(e,t,n){var r=null,o=this.sections.filter(function(n){return n.order===e&&n.layoutIndex===t});return o.length<1?(r=2===t?this.addVerticalSection():this.addSection(),r.order=e,r.emphasis=n):r=o[0],r},t.prototype.getItem=function(){for(var e=this,n=[],r=0;r")||(e="

"+e+"

"),this.data.innerHTML=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.data.position.controlIndex},set:function(e){this.data.position.controlIndex=e},enumerable:!0,configurable:!0}),t.prototype.onColumnChange=function(e){this.data.position.sectionFactor=e.factor,this.data.position.controlIndex=f(e.controls),this.data.position.zoneIndex=e.data.position.zoneIndex,this.data.position.sectionIndex=e.order,this.data.position.layoutIndex=e.data.position.layoutIndex},t.Default={addedFromPersistedData:!1,anchorComponentId:"",controlType:4,displayMode:2,editorType:"CKEditor",emphasis:{},id:"",innerHTML:"",position:{controlIndex:1,layoutIndex:1,sectionFactor:12,sectionIndex:1,zoneIndex:1}},t}(Rt),Ut=function(e){function t(n){return void 0===n&&(n=JSON.parse(JSON.stringify(t.Default))),e.call(this,n)||this}return r(t,e),t.fromComponentDef=function(e){var n=new t;return n.import(e),n},Object.defineProperty(t.prototype,"title",{get:function(){return this.data.webPartData.title},set:function(e){this.data.webPartData.title=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"description",{get:function(){return this.data.webPartData.description},set:function(e){this.data.webPartData.description=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.data.position.controlIndex},set:function(e){this.data.position.controlIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.data.reservedHeight},set:function(e){this.data.reservedHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.data.reservedWidth},set:function(e){this.data.reservedWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataVersion",{get:function(){return this.data.webPartData.dataVersion},set:function(e){this.data.webPartData.dataVersion=e},enumerable:!0,configurable:!0}),t.prototype.setProperties=function(e){return this.data.webPartData.properties=Object(y.f)(this.data.webPartData.properties,e),this},t.prototype.getProperties=function(){return this.data.webPartData.properties},t.prototype.onColumnChange=function(e){this.data.position={controlIndex:f(e.controls),layoutIndex:e.data.position.layoutIndex,sectionFactor:e.factor,sectionIndex:e.data.position.sectionIndex,zoneIndex:e.data.position.zoneIndex}},t.prototype.import=function(e){var t=Object(y.h)(),n=e.Id.replace(/^\{|\}$/g,"").toLowerCase(),r=JSON.parse(e.Manifest),o=r.preconfiguredEntries[0];this.setData(Object.assign({},this.data,{id:t,webPartData:{dataVersion:"1.0",description:o.description.default,id:n,instanceId:t,properties:o.properties,title:o.title.default},webPartId:n}))},t.Default={addedFromPersistedData:!1,controlType:3,displayMode:2,emphasis:{},id:null,position:{controlIndex:1,layoutIndex:1,sectionFactor:12,sectionIndex:1,zoneIndex:1},reservedHeight:500,reservedWidth:500,webPartData:null,webPartId:null},t}(Rt),kt=(new Map([["text","Querytext"],["template","QueryTemplate"],["sourceId","SourceId"],["trimDuplicatesIncludeId",""],["startRow",""],["rowLimit",""],["rankingModelId",""],["rowsPerPage",""],["selectProperties",""],["culture",""],["timeZoneId",""],["refinementFilters",""],["refiners",""],["hiddenConstraints",""],["sortList",""],["timeout",""],["hithighlightedProperties",""],["clientType",""],["personalizationData",""],["resultsURL",""],["queryTag",""],["properties",""],["queryTemplatePropertiesUrl",""],["reorderingRules",""],["hitHighlightedMultivaluePropertyLimit",""],["collapseSpecification",""],["uiLanguage",""],["desiredSnippetLength",""],["maxSnippetLength",""],["summaryLength",""]]),new Map([]),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.execute=function(e){var t=this,n=this.parseQuery(e),r=Object(y.n)({request:Object(y.f)(d("Microsoft.Office.Server.Search.REST.SearchRequest"),Object.assign({},n,{HitHighlightedProperties:this.fixArrProp(n.HitHighlightedProperties),Properties:this.fixArrProp(n.Properties),RefinementFilters:this.fixArrProp(n.RefinementFilters),ReorderingRules:this.fixArrProp(n.ReorderingRules),SelectProperties:this.fixArrProp(n.SelectProperties),SortList:this.fixArrProp(n.SortList)}))});if(this._useCaching){this._forceCaching=!0;var o="PnPjs.SearchWithCaching("+Object(y.i)(r)+")";Object(y.q)(this._cachingOptions)?/\/_api\/search\/postquery$/i.test(this._cachingOptions.key)&&(this._cachingOptions.key=o):this._cachingOptions=new v.c(o)}return this.postCore({body:r}).then(function(e){return new Lt(e,t.toUrl(),n)})},t.prototype.fixArrProp=function(e){return void 0===e?{results:[]}:(e=Object(y.k)(e)?e:[e],Object(y.j)(e,"results")?e:{results:e})},t.prototype.parseQuery=function(e){return"string"==typeof e?{Querytext:e}:e.toSearchQuery?e.toSearchQuery():e},t=o([h("_api/search/postquery")],t)}(R)),Lt=function(){function e(e,t,n,r,o){void 0===r&&(r=null),void 0===o&&(o=null),this._url=t,this._query=n,this._raw=r,this._primary=o,this._raw=e.postquery?e.postquery:e}return Object.defineProperty(e.prototype,"ElapsedTime",{get:function(){return this.RawSearchResults.ElapsedTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"RowCount",{get:function(){return this.RawSearchResults.PrimaryQueryResult.RelevantResults.RowCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"TotalRows",{get:function(){return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"TotalRowsIncludingDuplicates",{get:function(){return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"RawSearchResults",{get:function(){return this._raw},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"PrimarySearchResults",{get:function(){return null===this._primary&&(this._primary=this.formatSearchResults(this._raw.PrimaryQueryResult.RelevantResults.Table.Rows)),this._primary},enumerable:!0,configurable:!0}),e.prototype.getPage=function(e,t){if(this.TotalRowsthis.TotalRows?Promise.resolve(null):new kt(this._url,null).execute(r)},e.prototype.formatSearchResults=function(e){for(var t=new Array,n=e.results?e.results:e,r=0,o=n;r0&&(n.properties=Object(y.f)(n.properties,{To:{results:e.To}})),e.CC&&e.CC.length>0&&(n.properties=Object(y.f)(n.properties,{CC:{results:e.CC}})),e.BCC&&e.BCC.length>0&&(n.properties=Object(y.f)(n.properties,{BCC:{results:e.BCC}})),e.AdditionalHeaders&&(n.properties=Object(y.f)(n.properties,{AdditionalHeaders:e.AdditionalHeaders})),this.clone(t,"SendEmail",!0).excute(n)},t.prototype.getCurrentUserEmailAddresses=function(){return this.clone(t,"GetCurrentUserEmailAddresses",!0).excute({}).then(function(e){return Object(y.j)(e,"GetCurrentUserEmailAddresses")?e.GetCurrentUserEmailAddresses:e})},t.prototype.resolvePrincipal=function(e,n,r,o,i,a){void 0===a&&(a=!1);var s={addToUserInfoList:i,input:e,inputIsEmailOnly:o,matchUserInfoList:a,scopes:n,sources:r};return this.clone(t,"ResolvePrincipalInCurrentContext",!0).excute(s).then(function(e){return Object(y.j)(e,"ResolvePrincipalInCurrentContext")?e.ResolvePrincipalInCurrentContext:e})},t.prototype.searchPrincipals=function(e,n,r,o,i){var a={groupName:o,input:e,maxCount:i,scopes:n,sources:r};return this.clone(t,"SearchPrincipalsUsingContextWeb",!0).excute(a).then(function(e){return Object(y.j)(e,"SearchPrincipalsUsingContextWeb")?e.SearchPrincipalsUsingContextWeb:e})},t.prototype.createEmailBodyForInvitation=function(e){var n={pageAddress:e};return this.clone(t,"CreateEmailBodyForInvitation",!0).excute(n).then(function(e){return Object(y.j)(e,"CreateEmailBodyForInvitation")?e.CreateEmailBodyForInvitation:e})},t.prototype.expandGroupsToPrincipals=function(e,n){void 0===n&&(n=30);var r={inputs:e,maxCount:n};return this.clone(t,"ExpandGroupsToPrincipals",!0).excute(r).then(function(e){return Object(y.j)(e,"ExpandGroupsToPrincipals")?e.ExpandGroupsToPrincipals:e})},t.prototype.createWikiPage=function(e){return this.clone(t,"CreateWikiPageInContextWeb",!0).excute({parameters:e}).then(function(e){return{data:Object(y.j)(e,"CreateWikiPageInContextWeb")?e.CreateWikiPageInContextWeb:e,file:new tt(u(e))}})},t.prototype.containsInvalidFileFolderChars=function(e,n){return void 0===n&&(n=!1),n?(t.InvalidFileFolderNameCharsOnPremiseRegex.lastIndex=0,t.InvalidFileFolderNameCharsOnPremiseRegex.test(e)):(t.InvalidFileFolderNameCharsOnlineRegex.lastIndex=0,t.InvalidFileFolderNameCharsOnlineRegex.test(e))},t.prototype.stripInvalidFileFolderChars=function(e,n,r){return void 0===n&&(n=""),void 0===r&&(r=!1),r?e.replace(t.InvalidFileFolderNameCharsOnPremiseRegex,n):e.replace(t.InvalidFileFolderNameCharsOnlineRegex,n)},t.InvalidFileFolderNameCharsOnlineRegex=/["*:<>?\/\\|\x00-\x1f\x7f-\x9f]/g,t.InvalidFileFolderNameCharsOnPremiseRegex=/["#%*:<>?\/\\|\x00-\x1f\x7f-\x9f]/g,t}(x),Xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){return new Yt(this,"GetById?hubSiteId='"+e+"'")},t=o([h("_api/hubsites")],t)}(j),Yt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(R),$t=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t=""),this._options=e,this._baseUrl=t}return e.prototype.configure=function(t,n){return void 0===n&&(n=""),new e(t,n)},e.prototype.setup=function(e){l(e)},e.prototype.searchSuggest=function(e){var t;return t="string"==typeof e?{querytext:e}:e,this.create(Bt).execute(t)},e.prototype.search=function(e){return this.create(kt).execute(e)},e.prototype.searchWithCaching=function(e,t){return this.create(kt).usingCaching(t).execute(e)},Object.defineProperty(e.prototype,"site",{get:function(){return this.create(ht)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"web",{get:function(){return this.create(It)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"profiles",{get:function(){return this.create(Gt)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"social",{get:function(){return this.create(Wt)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"navigation",{get:function(){return this.create(yt)},enumerable:!0,configurable:!0}),e.prototype.createBatch=function(){return this.web.createBatch()},Object.defineProperty(e.prototype,"utility",{get:function(){return this.create(Jt,"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"siteScripts",{get:function(){return this.create(Ct,"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"siteDesigns",{get:function(){return this.create(wt,"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hubSites",{get:function(){return this.create(Xt)},enumerable:!0,configurable:!0}),e.prototype.getTenantAppCatalogWeb=function(){var e=this;return this.create(It,"_api/SP_TenantSettings_Current").get().then(function(t){return new It(t.CorporateCatalogUrl).configure(e._options)})},e.prototype.create=function(e,t){return new e(this._baseUrl,t).configure(this._options)},e}(),Zt=new $t}).call(t,n(1))},function(e,t,n){"use strict";(function(e){function r(e,t){function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){for(var n=[],r=2;r0&&(n=60*this.defaultTimeoutMinutes),t=i(new Date,"second",n)}return f({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;this.deleteExpired().then(function(t){setTimeout(o(e,e.cacheExpirationHandler),R.cacheExpirationIntervalMilliseconds)}).catch(function(e){console.error(e)})},e}(),U=function(){function e(e){void 0===e&&(e=new Map),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.size},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._store.clear()},e.prototype.getItem=function(e){return this._store.get(e)},e.prototype.key=function(e){return Array.from(this._store)[e][0]},e.prototype.removeItem=function(e){this._store.delete(e)},e.prototype.setItem=function(e,t){this._store.set(e,t)},e}(),k=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._local=e,this._session=t}return Object.defineProperty(e.prototype,"local",{get:function(){return null===this._local&&(this._local=this.getStore("local")),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=this.getStore("session")),this._session},enumerable:!0,configurable:!0}),e.prototype.getStore=function(e){return new A("local"===e?"undefined"==typeof localStorage?new U:localStorage:"undefined"==typeof sessionStorage?new U:sessionStorage)},e}()}).call(t,n(1))},function(e,t,n){"use strict";n.d(t,"a",function(){return o});/** * @license * v1.3.11 * MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) diff --git a/package-lock.json b/package-lock.json index a82eb45..ac0303d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mega-menu", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9f62c9a..2482559 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mega-menu", - "version": "1.1.0", + "version": "1.1.1", "private": true, "main": "lib/index.js", "engines": { diff --git a/sharepoint/assets/elements.xml b/sharepoint/assets/elements.xml new file mode 100644 index 0000000..f3bbefd --- /dev/null +++ b/sharepoint/assets/elements.xml @@ -0,0 +1,8 @@ + + + + diff --git a/temp/deploy/abc3361f-bb2d-491f-aba3-cd51c19a299b.json b/temp/deploy/abc3361f-bb2d-491f-aba3-cd51c19a299b.json index e6cdc85..5159596 100644 --- a/temp/deploy/abc3361f-bb2d-491f-aba3-cd51c19a299b.json +++ b/temp/deploy/abc3361f-bb2d-491f-aba3-cd51c19a299b.json @@ -1 +1 @@ -{"id":"abc3361f-bb2d-491f-aba3-cd51c19a299b","alias":"MegaMenuApplicationCustomizer","componentType":"Extension","extensionType":"ApplicationCustomizer","version":"1.1.0","manifestVersion":2,"requiresCustomScript":false,"loaderConfig":{"entryModuleId":"mega-menu-application-customizer","internalModuleBaseUrls":["/"],"scriptResources":{"mega-menu-application-customizer":{"type":"path","path":"mega-menu-application-customizer_0280cb624fe09d9608e12e4ea730705f.js"},"MegaMenuApplicationCustomizerStrings":{"defaultPath":"megamenu-megamenuapplicationcustomizerstrings_en-us_c5b741e5b77398ea44801b5b5c0a11a3.js","type":"localizedPath","paths":{"de-DE":"megamenu-megamenuapplicationcustomizerstrings_de-de_b346aef029646a3a296989aa5e40a5ae.js","en-US":"megamenu-megamenuapplicationcustomizerstrings_en-us_c5b741e5b77398ea44801b5b5c0a11a3.js"}},"@microsoft/decorators":{"type":"component","version":"1.4.1","id":"f97266fb-ccb7-430e-9384-4124d05295d3"},"@microsoft/sp-application-base":{"type":"component","version":"1.4.1","id":"4df9bb86-ab0a-4aab-ab5f-48bf167048fb"},"@microsoft/sp-http":{"type":"component","version":"1.4.1","id":"c07208f0-ea3b-4c1a-9965-ac1b825211a6"},"@microsoft/sp-lodash-subset":{"type":"component","version":"1.4.1","id":"73e1dc6c-8441-42cc-ad47-4bd3659f8a3a"}}}} \ No newline at end of file +{"id":"abc3361f-bb2d-491f-aba3-cd51c19a299b","alias":"MegaMenuApplicationCustomizer","componentType":"Extension","extensionType":"ApplicationCustomizer","version":"1.1.1","manifestVersion":2,"requiresCustomScript":false,"loaderConfig":{"entryModuleId":"mega-menu-application-customizer","internalModuleBaseUrls":["/"],"scriptResources":{"mega-menu-application-customizer":{"type":"path","path":"mega-menu-application-customizer_9c0a9d18bcd93369da3fd20a4ed3dd7c.js"},"MegaMenuApplicationCustomizerStrings":{"defaultPath":"megamenu-megamenuapplicationcustomizerstrings_en-us_c5b741e5b77398ea44801b5b5c0a11a3.js","type":"localizedPath","paths":{"en-US":"megamenu-megamenuapplicationcustomizerstrings_en-us_c5b741e5b77398ea44801b5b5c0a11a3.js","de-DE":"megamenu-megamenuapplicationcustomizerstrings_de-de_b346aef029646a3a296989aa5e40a5ae.js"}},"@microsoft/decorators":{"type":"component","version":"1.4.1","id":"f97266fb-ccb7-430e-9384-4124d05295d3"},"@microsoft/sp-application-base":{"type":"component","version":"1.4.1","id":"4df9bb86-ab0a-4aab-ab5f-48bf167048fb"},"@microsoft/sp-http":{"type":"component","version":"1.4.1","id":"c07208f0-ea3b-4c1a-9965-ac1b825211a6"},"@microsoft/sp-lodash-subset":{"type":"component","version":"1.4.1","id":"73e1dc6c-8441-42cc-ad47-4bd3659f8a3a"}}}} \ No newline at end of file diff --git a/temp/manifests.js b/temp/manifests.js index ddae8aa..698a403 100644 --- a/temp/manifests.js +++ b/temp/manifests.js @@ -2300,7 +2300,7 @@ function getManifests() { "alias": "MegaMenuApplicationCustomizer", "componentType": "Extension", "extensionType": "ApplicationCustomizer", - "version": "1.1.0", + "version": "1.1.1", "manifestVersion": 2, "requiresCustomScript": false, "loaderConfig": { diff --git a/temp/manifests.json b/temp/manifests.json index 5fffb3d..6db787c 100644 --- a/temp/manifests.json +++ b/temp/manifests.json @@ -695,7 +695,7 @@ "alias": "MegaMenuApplicationCustomizer", "componentType": "Extension", "extensionType": "ApplicationCustomizer", - "version": "1.1.0", + "version": "1.1.1", "manifestVersion": 2, "requiresCustomScript": false, "loaderConfig": {