1/*! For license information please see 3971.7643ba85fe8369942ac0.bundle.js.LICENSE.txt */ 2"use strict";(self.webpackChunkStackby_webapp=self.webpackChunkStackby_webapp||[]).push([[3971],{3971:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Ie});var o=a(71083),n=a(2543),s=a(379),r=a.n(s),i=a(63110),l=a.n(i),c=a(71468),d=a(77698),h=a(33365),u=a(92257),p=a(35907),m=a(56429),b=(a(21345),a(89253)),f=a(46856),w=a(48009),v=a(61474),g=a(20054),y=a(86663),S=a(82672),k=a(9872),x=a(64928),C=a(15180),I=a(29417),j=a(52666),D=a.n(j),T=a(53070),A=a(55969),R=a(49607),E=a(62986),N=a(63129),L=a(73591),P=a(70510);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function B(e,t){for(var a=0;a<t.length;a++){var o=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,F(o.key),o)}}function F(e){var t=function(e,t){if("object"!=M(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var o=a.call(e,t||"default");if("object"!=M(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==M(t)?t:t+""}function O(e,t,a){return t=W(t),function(e,t){if(t&&("object"==M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,V()?Reflect.construct(t,a||[],W(e).constructor):t.apply(e,a))}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(V=function(){return!!e})()}function W(e){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},W(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}var H=function(e){function t(e){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(a=O(this,t,[e])).state={workspaceList:[],stackList:[],workspaceListLoader:!1,stackListLoader:!1,workspaceId:"",stackId:"",copyStackId:e.copyStackId,copyTableId:e.copyTableId,crateTableLoader:!1,viewName:e.viewName,errorMessage:"",isSyncTable:!1,shareId:e.shareId,canCreateSync:!0,syncLimit:!1,allStackList:[]},a.close=a.close.bind(a),a.getWorkspaceList=a.getWorkspaceList.bind(a),a.getStackList=a.getStackList.bind(a),a.handleWorkspaceChange=a.handleWorkspaceChange.bind(a),a.handleStackChange=a.handleStackChange.bind(a),a.onCreateTable=a.onCreateTable.bind(a),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(t,e),a=t,n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){}},{key:"componentDidMount",value:function(){this.getWorkspaceList()}},{key:"getWorkspaceList",value:function(){var e=this;this.setState({workspaceListLoader:!0}),o.A.get("/api/v1/workspacelist").then(function(t){var a=JSON.parse((0,k.Y)(t.data.data)).map(function(e){return{key:e.workspaceId,text:e.workspaceName,value:e.workspaceId}});e.setState({workspaceList:a,workspaceListLoader:!1})}).catch(function(t){e.setState({workspaceListLoader:!1})})}},{key:"getStackList",value:function(e){var t=this;this.setState({stackListLoader:!0}),o.A.get("/api/v1/stacklist/".concat(e)).then(function(e){var a=JSON.parse((0,k.Y)(e.data.data)),o=a.list,n=a.planSlug,s=void 0===n?"":n,r=a.noOfSyncedTable,i=a.isSyncAllowed,l=void 0===i?0:i;s&&s.startsWith("business")||l?t.setState({canCreateSync:!0}):t.setState({canCreateSync:!1,isSyncTable:!1});var c=o.map(function(e){return{key:e.stackId,text:e.stackName,value:e.stackId}});t.setState({stackListLoader:!1,stackList:c,noOfSyncedTable:r,allStackList:o})}).catch(function(e){t.setState({stackListLoader:!1})})}},{key:"handleWorkspaceChange",value:function(e,t){var a=t.value;
2this.getStackList(a),this.setState({workspaceId:a,stackId:"",errorMessage:""})}},{key:"handleStackChange",value:function(e,t){var a=t.value,o=this.state,n=o.noOfSyncedTable,s=void 0===n?0:n,r=o.allStackList,i=void 0===r?[]:r,l=o.canCreateSync;this.setState({stackId:a,errorMessage:""});var c=i.find(function(e){return e.stackId==a})?i.find(function(e){return e.stackId==a}).syncCount:null;l&&(s<=(c&&c)?this.setState({syncLimit:!0,errorMessage:"Your sync creation limits are over for this plan. Please see your plan limits or upgrade your plan.",isSyncTable:!1}):this.setState({syncLimit:!1}))}},{key:"close",value:function(){this.props.close()}},{key:"onCreateTable",value:function(){var e=this,t=this.state,a=t.stackId,n=t.copyStackId,s=t.copyTableId,r=t.viewName,i=t.workspaceId,l=t.isSyncTable,c=t.shareId;if(n!=a){var d={copyStack:n,copyTable:s,name:r,tableId:"tb"+D().generate(16),isSyncTable:l?1:0,shareId:c};this.setState({crateTableLoader:!0}),o.A.post("/api/v1/tableaction/"+a+"/createfromview",d).then(function(t){e.setState({crateTableLoader:!1}),e.props.changeLastTable(a,d.tableId,i),setTimeout(function(){location.replace("/stack/"+a+"/"+d.tableId)},500)}).catch(function(t){e.setState({crateTableLoader:!1})})}else this.setState({errorMessage:"Cannot sync or copy data between tables in the same stack. Please select a shared view from a different stack"})}},{key:"render",value:function(){var e=this,t=this.state,a=t.workspaceList,o=t.workspaceListLoader,n=t.stackListLoader,s=t.stackList,r=t.crateTableLoader,i=t.stackId,l=t.isSyncTable,c=t.canCreateSync,d=t.syncLimit,h=(this.props.selectedView||{}).isSynced,u=void 0===h?0:h;return(0,P.jsx)(T.A,{id:"UseThisData",size:"small",open:!0,onClose:this.close,closeIcon:!0,children:(0,P.jsx)(T.A.Content,{scrolling:!0,style:{maxHeight:"calc(80vh)"},children:(0,P.jsxs)("div",{className:"form-content",children:[(0,P.jsx)(A.A,{className:"image",src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/embed+image.png",size:"medium",centered:!0}),(0,P.jsx)("div",{className:"header",children:"Use this data"}),(0,P.jsx)("div",{className:"description",children:"Create a copy of this data in Stackby, where you can build on it by adding your own fields with columns, creating custom views, or combining with other data."}),(0,P.jsxs)("div",{className:"dropdown",children:[(0,P.jsx)("div",{className:"dropdown-header",children:"Workspace"}),(0,P.jsx)(R.A,{placeholder:"Select workspace",fluid:!0,selection:!0,search:!0,selectOnBlur:!1,loading:o,options:a,onChange:this.handleWorkspaceChange})]}),this.state.workspaceId.length>0?(0,P.jsxs)("div",{className:"dropdown",children:[(0,P.jsx)("div",{className:"dropdown-header",children:"Stack"}),(0,P.jsx)(R.A,{placeholder:"Select stack",fluid:!0,selection:!0,search:!0,loading:n,options:s,onChange:this.handleStackChange})]}):(0,P.jsxs)("div",{className:"dropdown",children:[(0,P.jsx)("div",{className:"dropdown-header",children:"Stack"}),(0,P.jsx)(R.A,{fluid:!0,selection:!0,text:"Select stack",disabled:!0,icon:null})]}),1==u&&(0,P.jsxs)(E.A,{className:"radio-btn-sec",children:[(0,P.jsx)(N.A,{children:(0,P.jsx)(L.A,{label:"Create a synced table that will be kept up-to-date as this data changes",name:"radioGroup",value:"this",checked:1==l,onChange:function(){return e.setState({isSyncTable:!l})},disabled:!c||d})}),(0,P.jsx)(N.A,{children:(0,P.jsx)(L.A,{label:"Copy this data into a new table that you can edit",name:"radioGroup",value:"that",checked:0==l,onChange:function(){return e.setState({isSyncTable:!l})}})})]}),this.state.errorMessage&&(0,P.jsxs)("div",{className:"error-usethisdata",children:[" ",this.state.errorMessage," "]}),!c&&!d&&(0,P.jsxs)("p",{style:{marginTop:"10px"},children:["You need to upgrade this workspace to create a synced table.",(0,P.jsxs)("a",{target:"_blank",href:"/pricing",children:[" ","See plans"]})]}),(0,P.jsxs)("div",{className:"buttons",children:[(0,P.jsx)(m.A,{onClick:this.close,style:{marginRight:"10px"},children:"Cancel"}),(0,P.jsx)(m.A,{primary:!0,onClick:this.onCreateTable,loading:r,disabled:!i,children:"Create table"})]})]})})})}}],n&&B(a.prototype,n),s&&B(a,s),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,n,s}(s.Component),U={changeLastTable:C.j8};const z=(0,c.Ng)(function(e){return{socket:e.socket,auth:e.auth,table:e.table}},U)(H);var G=a(128),J=a(37190),K=a(60355),Y=(a(17851),a(51384)),q=a(96763);function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function X(e,t,a){return(t=ae(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function $(){var e,t,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",n=a.toStringTag||"@@toStringTag";function s(a,o,n,s){var l=o&&o.prototype instanceof i?o:i,c=Object.create(l.prototype);return Z(c,"_invoke",function(a,o,n){var s,i,l,c=0,d=n||[],h=!1,u={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,a){return s=t,i=0,l=e,u.n=a,r}};function p(a,o){for(i=a,l=o,t=0;!h&&c&&!n&&t<d.length;t++){var n,s=d[t],p=u.p,m=s[2];a>3?(n=m===o)&&(l=s[(i=s[4])?5:(i=3,3)],s[4]=s[5]=e):s[0]<=p&&((n=a<2&&p<s[1])?(i=0,u.v=o,u.n=s[1]):p<m&&(n=a<3||s[0]>o||o>m)&&(s[4]=a,s[5]=o,u.n=m,i=0))}if(n||a>1)return r;throw h=!0,o}return function(n,d,m){if(c>1)throw TypeError("Generator is already running");for(h&&1===d&&p(d,m),i=d,l=m;(t=i<2?e:l)||!h;){s||(i?i<3?(i>1&&(u.n=-1),p(i,l)):u.n=l:u.v=l);try{if(c=2,s){if(i||(n="next"),t=s[n]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");
vendor: 4,101 bytes, line 2
2if(!t.done)return t;l=t.value,i<2&&(i=0)}else 1===i&&(t=s.return)&&t.call(s),i<2&&(l=TypeError("The iterator does not provide a '"+n+"' method"),i=1);s=e}else if((t=(h=u.n<0)?l:a.call(o,u))!==r)break}catch(t){s=e,i=1,l=t}finally{c=1}}return{value:t,done:h}}}(a,n,s),!0),c}var r={};function i(){}function l(){}function c(){}t=Object.getPrototypeOf;var d=[][o]?t(t([][o]())):(Z(t={},o,function(){return this}),t),h=c.prototype=i.prototype=Object.create(d);function u(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Z(e,n,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,Z(h,"constructor",c),Z(c,"constructor",l),l.displayName="GeneratorFunction",Z(c,n,"GeneratorFunction"),Z(h),Z(h,n,"Generator"),Z(h,o,function(){return this}),Z(h,"toString",function(){return"[object Generator]"}),($=function(){return{w:s,m:u}})()}function Z(e,t,a,o){var n=Object.defineProperty;try{n({},"",{})}catch(e){n=0}Z=function(e,t,a,o){function s(t,a){Z(e,t,function(e){return this._invoke(t,a,e)})}t?n?n(e,t,{value:a,enumerable:!o,configurable:!o,writable:!o}):e[t]=a:(s("next",0),s("throw",1),s("return",2))},Z(e,t,a,o)}function ee(e,t,a,o,n,s,r){try{var i=e[s](r),l=i.value}catch(e){return void a(e)}i.done?t(l):Promise.resolve(l).then(o,n)}function te(e,t){for(var a=0;a<t.length;a++){var o=t[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ae(o.key),o)}}function ae(e){var t=function(e,t){if("object"!=Q(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var o=a.call(e,t||"default");if("object"!=Q(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Q(t)?t:t+""}function oe(e,t,a){return t=se(t),function(e,t){if(t&&("object"==Q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,a||[],se(e).constructor):t.apply(e,a))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ne=function(){return!!e})()}function se(e){return se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},se(e)}function re(e,t){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},re(e,t)}function ie(e){return function(e){if(Array.isArray(e))return le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return le(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?le(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,o=Array(t);a<t;a++)o[a]=e[a];return o}var ce=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,61309)),componentProps:e})},de=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,27796)),componentProps:e})},he=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,56066)),componentProps:e})},ue=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,85568)),componentProps:e})},pe=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,62791)),componentProps:e})},me=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,5442)),componentProps:e})},be=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,447
252)),componentProps:e})},fe=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,52337)),componentProps:e})},we=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,21237)),componentProps:e})},ve=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,76885)),componentProps:e})},ge=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,85789)),componentProps:e})},ye=function(e){return(0,P.jsx)(l(),{load:Promise.all([a.e(8096),a.e(2076)]).then(a.bind(a,8377)),componentProps:e})},Se={position:"bottom-left",autoClose:!0,closeButton:!1},ke=function(e,t){var a,o=null==e?void 0:e.rowData;if(!Array.isArray(t)||!t.length||!Array.isArray(o))return null;var n=t.filter(function(e){return!e.hasChildGroup}),s=n.length>0?n:t;return(a=[]).concat.apply(a,ie(s.map(function(e){return e.rowIdsPerGroup||[]}))).map(function(e){return o[e]}).filter(Boolean)},xe=function(e){function t(e){var a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),q.log(e,":::===props123123"),a=oe(this,t,[e]);var o=y.parse(a.props.location.search),s=o.type,r=void 0===s?null:s,i=o.copyLinkToColumnOrigin;a.state={isMobile:document.body.clientWidth<765,stackId:e.match.params.stackId,stackName:"",searchValue:"",searchArray:[],searchArrayIndex:0,pasteData:"",fetching:!0,loading:!0,showCustomizedCardsModel:!1,showChangeRowDataSize:!1,contextOpen:!1,viewSelectorOpen:!1,visible:!0,open:!1,isNewTable:!1,disableChangeInGrid:!1,responseArrayLength:0,renameViewInput:!1,showHeightModel:!1,viewSelectedColumnId:"",showColumnSelectModel:!1,showColumnNamesInCards:!0,cardCoverImageColumnId:"no-cover-image",cardFooterSelectorColumnId:"no-footer-collaborators",startRange:0,endRange:0,keyBoardShortcutsMenu:!1,notfound:!1,rowData:!1,expandView:[],IsExpandedDashboard:!1,cardCoverGalleryImageColumnId:"no-cover-image",showUseThisData:!1,currentUserLogin:!1,isEmailDomainRestricted:!1,blockWidth:"25%",persent:(document.body.clientWidth-500)/document.body.clientWidth*100,isShowCustomDashboardEmbed:!!localStorage.getItem("isShowCustomDashboardEmbed")&&JSON.parse(localStorage.getItem("isShowCustomDashboardEmbed")),isProtected:0,passwordSession:!1,passwordProtectInput:"",passwordProtectError:null,viewSectionWidth:localStorage.getItem("viewSectionWidth")?localStorage.getItem("viewSectionWidth"):"200px",selectedView:"",isAppExpanded:!1,checkFirstTimeSharedViewLoad:!0,selectedRow:"",selectButtonBlockId:"",type:r,showConfig:!0,showAddMoreButton:!0,selectedBlockId:null,blockType:null,isCopyLinkToColumnOrigin:i||!1,colorCondition:[],colorSelectedColumnId:"",colorType:""},a.talbeListContainer,a.handleKeyPress=a.handleKeyPress.bind(a),a.handleContextMenu=a.handleContextMenu.bind(a),a._showHeightModel=a._showHeightModel.bind(a),a._showCustomizedCardsModel=a._showCustomizedCardsModel.bind(a),a.updateMetadata=a.updateMetadata.bind(a),a.handleShowColumnNamesInCards=a.handleShowColumnNamesInCards.bind(a),a.handleshowColumnSelectModel=a.handleshowColumnSelectModel.bind(a),a.setCardCoverImageColumnId=a.setCardCoverImageColumnId.bind(a),a.setCardFooterSelectorColumnId=a.setCardFooterSelectorColumnId.bind(a),a.changeLastTable=a.changeLastTable.bind(a),a.fetchStackData=a.fetchStackData.bind(a),a.convertCSV=a.convertCSV.bind(a),a.setParentCompState=a.setParentCompState.bind(a),a.changeFieldType=a.changeFieldType.bind(a),a.handleSearchChange=(0,n.debounce)(a.handleSearchChange.bind(a),300,{leading:!1,trailing:!0}),a.onClickSearchButton=(0,n.debounce)(a.onClickSearchButton.bind(a),300,{leading:!0,trailing:!1}),a.incEndRangeForAddRecordInKanban=a.incEndRangeForAddRecordInKanban.bind(a),a.showDashboard=a.showDashboard.bind(a),a.handleExpandDashboard=a.handleExpandDashboard.bind(a),a.onMessageReceived=a.onMessageReceived.bind(a),a.renderNotFound=a.renderNotFound.bind(a),a.getEmailDomainRestricted=a.getEmailDomainRestricted.bind(a),a.renderEmailDomainRestricted=a.renderEmailDomainRestricted.bind(a),a.getTableData=a.getTableData.bind(a),a.isSharedEmbedLink=a.isSharedEmbedLink.bind(a),a.isFetchedShareTableValid=a.isFetchedShareTableValid.bind(a),a.setShareUnavailableState=a.setShareUnavailableState.bind(a),a.handleSharedLinkFetchError=a.handleSharedLinkFetchError.bind(a),a.removeScollToBody=a.removeScollToBody.bind(a),a.getPasswordSession=a.getPasswordSession.bind(a),a.openSyncModel=a.openSyncModel.bind(a),a.showAddMoreButton=a.showAddMoreButton.bind(a),a.fetchDashboardList=a.fetchDashboardList.bind(a),a.showDashboardForButtonColumnClick=a.showDashboardForButtonColumnClick.bind(a),a.handleBlockModal=a.handleBlockModal.bind(a);var l=setInterval(function(){if(window.Gleap){try{window.Gleap.hide(),window.Gleap.close(),window.Gleap.clearIdentity()}catch(e){q.warn("Error handling Gleap",e)}clearInterval(l)}},300);return a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&re(e,t)}(t,e),a=t,s=[{key:"UNSAFE_componentWillMount",value:function(){this.getEmailDomainRestricted()}},{key:"componentDidMount",value:function(){var e=this,t=this.props.match.params.stackId;this.props.fetchAllStackList(t).catch(function(a){e.isSharedEmbedLink(t)&&e.handleSharedLinkFetchError(a)}),window.addEventListener("message",this.onMessageReceived,!1),document.addEventListener("keydown",this.handleKeyPress),this.removeScollToBody(!0),this.getTableData();var a=y.parse(this.props.location.search),o=a.isShowDashboard,n=void 0!==o&&o,s=a.blockId,r
2=void 0!==s&&s;n?(this.setState({isShowCustomDashboardEmbed:n,createdAppBlockId:r}),window.history.pushState(null,null,window.location.pathname)):this.setState({isShowCustomDashboardEmbed:!1,showBlockModal:!1,blockType:null,selectedBlockId:null})}},{key:"openSyncModel",value:function(){var e=this;if(window.location.search.includes("syncModelOpen=true")){var t=window.location.href.replace("?syncModelOpen=true","");setTimeout(function(){e.setState({showUseThisData:!0})},1e3),window.history.replaceState({},document.title,t)}}},{key:"isSharedEmbedLink",value:function(e){return(null==e?void 0:e.startsWith("shr"))||(null==e?void 0:e.startsWith("vwshr"))}},{key:"isFetchedShareTableValid",value:function(e,t){if(!e)return!1;var a=Array.isArray(e.viewsData)?e.viewsData:[];return!(0===a.length||!e.lastViewId)&&!!a.some(function(t){return t.viewId===e.lastViewId})&&!(null!=t&&t.startsWith("vwshr")&&!e.isSharedView)&&Array.isArray(e.columnSchema)}},{key:"setShareUnavailableState",value:function(){this.setState({loading:!1,fetching:!1,notfound:!0,rowData:null})}},{key:"handleSharedLinkFetchError",value:function(e){var t,a,o;502===(null==e||null===(t=e.response)||void 0===t?void 0:t.status)&&null!=e&&null!==(a=e.response)&&void 0!==a&&null!==(a=a.data)&&void 0!==a&&null!==(a=a.error)&&void 0!==a&&null!==(o=a.includes)&&void 0!==o&&o.call(a,"Authorization Required")||this.setShareUnavailableState()}},{key:"getTableData",value:function(){var e=this,t=this.props.location.pathname.split("/")[3]||"";if(t.startsWith("tb")&&this.props.table.lastTableId!==t)this.changeLastTable(t);else{this.setState({isView:this.props.match.params.stackId.startsWith("vwshr")});var a=this.props.match.params.stackId;this.props.fetchTable(a).then(function(){e.isFetchedShareTableValid(e.props.table,a)?(e.setState({loading:!1,fetching:!1,checkFirstTimeSharedViewLoad:!1}),e.fetchStackData(a),e.getPasswordSession(),e.openSyncModel()):e.setShareUnavailableState()}).catch(function(t){e.handleSharedLinkFetchError(t)})}var o=y.parse(this.props.location.search),n=o.isHideHeader,s=void 0!==n&&n,r=o.isHideApps,i=void 0!==r&&r,l=o.layout,c=o.viewControls,d=void 0===c||c;this.state.isView,this.props.match.params.stackId.startsWith("vwshr")||this.setState({isHideHeader:s}),this.setState({isHideApps:i,layout:l,viewControls:"false"!=d})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this;if(window.Gleap&&this.handleGleapClose(),e.table&&e.table.viewsData&&e.table.viewsData[0].filters&&this.state.checkFirstTimeSharedViewLoad){var a=JSON.parse(e.table.viewsData[0].filters);this.props.removeSortFiltersViewEmbed(a)}var o=this.state.selectedView,s={};if(e.table.viewsData&&(s=e.table.viewsData.find(function(t){return t.viewId===e.table.lastViewId})||{}),this.props.match.params.stackId!==e.match.params.stackId){this.setState({stackId:e.match.params.stackId,fetching:!0});var r=e.match.params.stackId;this.props.fetchTable(r).then(function(){t.isFetchedShareTableValid(e.table,r)?(t.setState({loading:!1,fetching:!1}),t.fetchStackData(r)):t.setShareUnavailableState()}).catch(function(e){return t.handleSharedLinkFetchError(e)})}if(this.setState({expandView:e.table.expandView}),(0,v.kT)(e.table).then(function(a){var r=function(e){if(!e||!["grid","list"].includes(e.type))return!1;try{var t=e.groupLevels?JSON.parse(e.groupLevels):null;return!!(t&&t.groupLevelsSet&&t.groupLevelsSet.length>0)}catch(e){return!1}}(s);if(r&&s&&o.viewId===s.viewId&&(o.filters!==s.filters||o.sort!==s.sort||o.groupLevels!==s.groupLevels||o.rowHeight!==s.rowHeight||t.props.table.groupByRowData!==e.table.groupByRowData))(0,G.LF)(e.table,a).then(function(o){var s=o.groupByRowData,r=ke(e.table,s)||a.filter(function(e){return e});o.filteredRowData=r,(0,n.isEqual)(s,e.table.groupByRowData)||t.props.updateGroupByRowData(o||[]),t.setState({rowData:r})}).catch(function(e){q.log("eee",e)});else{var i=a;r&&e.table.groupByRowData&&(i=ke(e.table,e.table.groupByRowData)||a),t.setState({rowData:i})}}),this.setState({selectedView:s}),this.props.table.lastViewId!==e.table.lastViewId&&setTimeout(function(){t.setState({fetching:!0,loading:!0}),t.fetchStackData()},100),e.table.viewsData){var i=e.table.viewsData.find(function(t){return t.viewId===e.table.lastViewId})||{},l=(e.auth,[]),c="",d="";i.colorConfig&&(d=(l=JSON.parse(i.colorConfig))?l.type:"",c=l?l.selectColumnId:"",l=l?null==l.colorDefinitions?[]:l.colorDefinitions:[]),this.setState({selectedView:i,colorCondition:l,colorSelectedColumnId:c,colorType:d})}}},{key:"componentDidUpdate",value:function(e,t){e.table.stackName!==this.props.table.stackName&&(document.title=this.props.table.stackName?this.props.table.stackName+" - Stackby":"Stackby");var a=this.state,o=a.stackId,n=a.loading,s=a.fetching,r=a.notfound,i=a.passwordSession;if(!this.isSharedEmbedLink(o)||n||s||r||i||this.isFetchedShareTableValid(this.props.table,o)||this.setShareUnavailableState(),this.props.location.pathname!==e.location.pathname){var l=this.props.location.pathname.split("/")[3]||"";(e.location.pathname.split("/")[3]||"")!==l&&this.changeLastTable(l)}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyPress),window.removeEventListener("message",this.onMessageReceived,!1),this.removeScollToBody(!0)}},{key:"getCurrentUser",value:function(){var e=this;o.A.get("/api/v1/currentuser").then(function(t){e.setState({currentUserLogin:!0})}).catch(function(t){e.setState({currentUserLogin:!1})})}},{key:"getEmailDomainRestricted",value:function(){var e=this,t=this.props.match.params.stackId,a=window.location.pathname.includes("/view"),n=a?"/api/v1/checkviews/":"/api/v1/checkstack/";o.A.get(n+t).then(function(t){var o={isProtected:!1,isDomianRestricted:!1},n=(o=a?t.data.data:JSON.parse((0,k.Y)(t.data.data))).isDomianRestricted,s=o.isProtected||!1;a||(s=o.isPasswordRestricted?1:0),e.setState({isEmailDomainRestricted:n,isProtected:s}),e.getCurrentUser()}).catch(function(a){e.getCurrentUser(),e.isSharedEmbedLink(t)&&null!=a&&a.response&&e.handleSharedLinkFetchError(a)})}},{key:"getPasswordSession",value:function(){var e=this.state,t=(e.passwordSession,e.stackId),a=e.isProtected,o=e.isView,n=this.props.table,s=n.viewsData,r=n.lastViewId,i=n.auth,l=void 0===i?"":i;if(o){var c=s.find(function(e){return e.viewId===r}),d=(c.type,c.metadata);if(d=JSON.parse(d)||{},q.log(":: isProtected",a),0==Number(a)||!d.password)return;JSON.stringify(localStorage.getItem(t))==JSON.stringify(d.password)?this.setState({passwordSession:!1}):this.setState({passwordSession:!0})}else{var h=(0,k.Y)(l);if(0==Number(a)||!h)return;JSON.stringify(localStorage.getItem(t))==JSON.stringify(h)?this.setState({passwordSession:!1}):this.setState({passwordSession:!0})}}},{key:"handlePasswordProtect",value:function(){var e=this,t=this.state,a=(t.passwordSession,t.stackId),o=t.passwordProtectInput,n=t.isView,s=this.props.table,r=s.viewsData,i=s.lastViewId,l=s.auth,c=void 0===l?"":l,d=r.find(function(e){return e.viewId===i}),h=(d.type,d.metadata),u="";o===(u=n?(h=JSON.parse(h)||{}).password:(0,k.Y)(c))?(localStorage.setItem(a,u),setTimeout(function(){e.getPasswordSession()},20)):this.setState({passwordProtectError:"Incorrect Password"})}},{key:"onMessageReceived",value:function(e){this.props.table.stackUsers,this.state.stackId;var t="string"==typeof e.data?JSON.parse(e.data):{},a=(t.rowData,t.columnSchema,t.filters,t.blockId),o=t.action,n=t.tableId,s=t.selectedRowIndexes,r=(t.selectedIndex,t.isopenRowModal);
2if(t.isopenRowModalblockId,t.blockname,t.isVisible,t.blockFields,t.blockType,o)switch(o){case"getfilterRowData":var i=(0,v.kT)(this.props.table),l={filteredData:i,action:"getfilterRowData"};i&&i.length>0&&document.getElementById(a).contentWindow.postMessage(JSON.stringify(l),"*");break;case"gettableData":var c={table:this.props.table,action:"gettableData"};document.getElementById(a).contentWindow.postMessage(JSON.stringify(c),"*");break;case"openRowModal":this.setState({isopenRowModal:r,tableIdFromBlock:n,selectedRowIndexes:s,blockIdFromBlock:a})}}},{key:"handleKeyPress",value:function(e){"Escape"===e.key&&this.props.closeExpandView()}},{key:"setParentCompState",value:function(e){this.setState(e)}},{key:"convertCSV",value:function(){var e=this.props.table,t=e.columnSchema,a=e.stackUsers,o=e.tableList,n=e.viewsData,s=e.lastTableId,r=e.lastViewId,i=(this.state.stackId,this.state.rowData);(0,f.t)(i,t,a,o,n,s,r),this.setState({contextOpen:!1})}},{key:"changeLastTable",value:function(e){var t=this,a=this.state.stackId;this.setState({fetching:!0,searchArray:[],searchArrayIndex:"",tableRenameOpen:!1}),this.props.fetchTable(a,e).then(function(){t.isFetchedShareTableValid(t.props.table,a)?t.setState({loading:!1}):t.setShareUnavailableState()}).catch(function(e){return t.handleSharedLinkFetchError(e)})}},{key:"tableMove",value:function(e,t){var a={index:t,idArray:[e],tableId:e,viewId:this.props.table.lastViewId};this.props.moveTable(this.state.stackId,a).then(function(e){h.oR.info("Table Moved",Se)}).catch(function(e){h.oR.error("Error Updating Table",Se)})}},{key:"changeFieldType",value:function(e,t,a,o,n){this.props.updateColumnConfig(this.state.stackId,e,t,a,o,n,this.props.table)}},{key:"rowHeightUpdate",value:function(e){this.setState({showHeightModel:!1});var t={height:e,viewId:this.props.table.lastViewId};this.props.updateRowHeight(this.state.stackId,t).catch(function(e){h.oR.error("Error Updating Row Height",Se)})}},{key:"fetchStackData",value:(i=$().m(function e(t){var a,o,n,s,r,i,l,c,d,h,u,p,m,b,f,w,v,g,y,S,k,x,C,I,j,D,T,A,R,E,N,L,P,M,B=this;return $().w(function(e){for(;;)switch(e.n){case 0:a=this.props.table,o=a.rowData,n=a.viewsData,s=a.lastViewId,(r=this.state).rowHeightList,i=r.isView,l=void 0!==i&&i;try{c=n.find(function(e){return e.viewId===s}),d=(c||{}).isHideHeader,h=void 0===d?0:d,u=n.find(function(e){return e.viewId===s}),p=u.groupLevels,m="",f="",w=this.state.startRange,v=o.length>100?100:o.length,this.fetchDashboardList(this.props.table.stackId),p&&["grid","list"].includes(c.type)?(g=this.state.rowData.length>0?this.state.rowData:o,(0,G.LF)(this.props.table,g).then(function(e){var t=e.groupByRowData,a=ke(B.props.table,t)||[];B.props.updateGroupByRowData(e||[]),B.setState({rowData:a,fetching:!1,loading:!1})}).catch(function(e){q.log("eee",e)})):this.setState({loading:!1,fetching:!1}),p&&(y=JSON.parse(p)[0]||{},S=y.columnId,m=void 0===S?"":S,k=JSON.parse(p)[0]||{},x=k.startRangeColumnId,C=void 0===x?"":x,I=k.endRangeColumnId,b=C,f=void 0===I?"":I,(j=JSON.parse(p)[1])&&(w=j.rowStartRange,v=j.rowEndRange)),D=c.metadata?JSON.parse(c.metadata):{},T=D.coverImageColumnId,A=void 0===T?"no-cover-image":T,R=D.footerSelectorColumnId,E=void 0===R?"no-footer-collaborators":R,N=D.coverImageGalleryColumnId,L=void 0===N?"no-cover-image":N,P=D.showColumnNamesInCards,M=void 0===P||P,this.setState({viewSelectedColumnId:m,startRangeColumnId:b,endRangeColumnId:f,showColumnNamesInCards:M,cardCoverImageColumnId:A,cardFooterSelectorColumnId:E,cardCoverGalleryImageColumnId:L,startRange:w,endRange:v,searchArray:[],searchArrayIndex:0,searchValue:"",selectedView:c}),l&&this.setState({isHideHeader:0!=h})}catch(e){q.log(e,"e"),this.setState({searchArray:[],searchArrayIndex:0,searchValue:""})}case 1:return e.a(2)}},e,this)}),l=function(){var e=this,t=arguments;return new Promise(function(a,o){var n=i.apply(e,t);function s(e){ee(n,a,o,s,r,"next",e)}function r(e){ee(n,a,o,s,r,"throw",e)}s(void 0)})},function(e){return l.apply(this,arguments)})},{key:"updateMetadata",value:function(e,t,a){var n=this.props.table,s=n.viewsData,r=void 0===s?[]:s,i=n.lastViewId,l=n.lastTableId,c=this.state,d=c.showColumnNamesInCards,u=c.cardCoverImageColumnId,p=c.cardFooterSelectorColumnId,m=r.find(function(e){return e.viewId===i}),b=m.type,f=m.metadata,w={tableId:l,viewId:i};if("grid"===b){var v=f&&JSON.parse(f);
2v?"update"===a?Object.assign(v.grid.summaryBarConfigsByColumnId,X({},e,{aggregationFunction:t})):"delete"===a&&delete v.grid.summaryBarConfigsByColumnId[e]:v={grid:{summaryBarConfigsByColumnId:X({},e,{aggregationFunction:t})}},v=JSON.stringify(v),w.metadata=v}else"kanban"===b&&(w.metadata=JSON.stringify({showColumnNamesInCards:d,coverImageColumnId:u||"no-cover-image",footerSelectorColumnId:p||"no-footer-collaborators"}));o.A.post("/api/v1/viewaction/"+this.state.stackId+"/updatemetadata",w).catch(function(e){h.oR.error("Error updating FieldType",Se)})}},{key:"handleShowColumnNamesInCards",value:function(e,t){var a=this;this.setState({showColumnNamesInCards:!this.state.showColumnNamesInCards},function(){return a.updateMetadata()})}},{key:"handleshowColumnSelectModel",value:function(){this.setState({showColumnSelectModel:!1})}},{key:"setCardCoverImageColumnId",value:function(e,t){var a=this;this.setState({cardCoverImageColumnId:t.value},function(){return a.updateMetadata()})}},{key:"setCardFooterSelectorColumnId",value:function(e,t){var a=this;this.setState({cardFooterSelectorColumnId:t.value},function(){return a.updateMetadata()})}},{key:"updateGroupLevel",value:function(e,t){var a=this.props.table,n=a.viewsData.find(function(e){return e.viewId===a.lastViewId}).groupLevels,s=void 0===n?"[{}]":n,r={rowStartRange:e,rowEndRange:t};(s=JSON.parse(s))[1]=r;var i={tableId:a.lastTableId,viewId:a.lastViewId,groupLevels:JSON.stringify(s)};o.A.post("/api/v1/viewaction/"+this.state.stackId+"/updategroup",i).then(function(e){}).catch(function(e){h.oR.error("Error updating FieldType",{position:"bottom-left",autoClose:!0,closeButton:!1})})}},{key:"setKanbanRowRange",value:function(e,t){var a=this;this.setState({startRange:e,endRange:t,showChangeRowDataSize:!1},function(){a.updateGroupLevel(e,t)})}},{key:"_showCustomizedCardsModel",value:function(){var e=this.props.table,t=this.state,a=t.viewSelectedColumnId,o=t.showColumnNamesInCards,s=t.cardCoverImageColumnId,r=t.cardFooterSelectorColumnId,i=(0,n.find)(e.viewsData,{viewId:e.lastViewId});return(0,P.jsx)(w.A,{viewData:i,columnSchema:e.columnSchema,stackId:this.state.stackId,viewSelectedColumnId:a,showColumnNamesInCards:o,cardCoverImageColumnId:s,cardFooterSelectorColumnId:r,handleShowColumnNamesInCards:this.handleShowColumnNamesInCards,setCardCoverImageColumnId:this.setCardCoverImageColumnId,setCardFooterSelectorColumnId:this.setCardFooterSelectorColumnId})}},{key:"_showHeightModel",value:function(){var e=this;return(0,P.jsxs)("ul",{className:"contex-menu context-view-menu",ref:this.setWrapperRef,children:[(0,P.jsxs)("li",{onClick:function(t){e.rowHeightUpdate("short")},children:[(0,P.jsx)(b.A,{icon:"md-reorder",fontSize:"16px",color:"#212121"}),(0,P.jsx)("span",{children:" Short "})]}),(0,P.jsxs)("li",{onClick:function(t){e.rowHeightUpdate("medium")},children:[(0,P.jsx)(b.A,{icon:"md-reorder",fontSize:"16px",color:"#212121"}),(0,P.jsx)("span",{children:" Medium "})]}),(0,P.jsxs)("li",{onClick:function(t){e.rowHeightUpdate("tall")},children:[(0,P.jsx)(b.A,{icon:"md-reorder",fontSize:"16px",color:"#212121"}),(0,P.jsx)("span",{children:" Tall "})]}),(0,P.jsxs)("li",{onClick:function(t){e.rowHeightUpdate("extraTall")},children:[(0,P.jsx)(b.A,{icon:"md-reorder",fontSize:"16px",color:"#212121"}),(0,P.jsx)("span",{children:" Extra Tall "})]})]})}},{key:"removeScollToBody",value:function(e){document.body.style.overflow=e?"hidden":"auto"}},{key:"handleContextMenu",value:function(){this.setState({contextOpen:!1})}},{key:"handleSearchChange",value:function(e,t){var a=this,o=this.props.table,n=o.columnSchema,s=o.stackUsers,r=this.props.table.viewsData.find(function(e){return e.viewId===a.props.table.lastViewId})||{};(0,J.A)(e,n,s,t,r.type).then(function(e){var t=e.searchArray;a.setState({searchArray:t,searchArrayIndex:-1,searchLoading:!1}),t.length>0&&a.onClickSearchButton("down")})}},{key:"onClickSearchButton",value:function(e){var t=this.state,a=t.searchArrayIndex,o=t.searchArray.length-1;"up"==e?a-=1:a+=1,a>o?a=0:-1==a&&(a=o),this.setState({searchArrayIndex:a})}},{key:"incEndRangeForAddRecordInKanban",value:function(){var e=this,t=this.state,a=t.startRange,o=t.endRange,n=0;o-a<100&&(n=Number(o)+1,this.setState({endRange:n},function(){return e.setKanbanRowRange(a,n)}))}},{key:"showDashboard",value:function(){this.props.dashboard,this.state.stackId,localStorage.setItem("isShowCustomDashboardEmbed",!this.state.isShowCustomDashboardEmbed),this.setState({isShowCustomDashboardEmbed:!this.state.isShowCustomDashboardEmbed})}},{key:"fetchDashboardList",value:function(e){var t=this.props.fetchDashboardList;t(e)}},{key:"handleBlockModal",value:function(e,t,a){var n=this.props,s=(n.fetchTableForDashboard,n.table.tableList,this.props.dashboard,this.state),r=(s.blocks,s.isModal,s.stackId,s.showConfig),i=a||null,l=e||null;if(i){var c={showConfig:!r,action:"showConfig"};if("settings"===t)this.setState({expandBlock:"expand-block",showConfig:!r});else if("expand"===t)this.setState({expandBlock:"expand-block",showConfig:!0,selectedBlockId:i,blockType:l,isShowCustomDashboardEmbed:!0,showBlockModal:!0}),c={isOpen:!0,action:"blockStatus",blockid:i};else if("close"===t){isFlag=!1,c={isOpen:!1,action:"blockStatus",blockid:i};var d={action:"SETTING_OPEN",flag:"false",blockId:i};o.A.post("https://stackby.com/api/v1/blockactivity/"+i,d),this.setState({expandBlock:"expand-block",showConfig:!1,selectedBlockId:r?null:i})}document.getElementById(i)&&document.getElementById(i).contentWindow.postMessage(JSON.stringify(c),"*")}}},{key:"showDashboardForButtonColumnClick",value:function(e,t,a){var o=this;localStorage.setItem("isShowCustomDashboardEmbed",!0),this.setState({isShowCustomDashboardEmbed:!0,showBlockModal:!1,blockType:null,selectedBlockId:null,
2selectedRow:e,selectButtonBlockId:t}),a&&(setTimeout(function(){o.handleBlockModal(a,"expand",t)},600),this.props.showViewSectionAction(!1))}},{key:"showAddMoreButton",value:function(e){this.setState({showAddMoreButton:e})}},{key:"handleExpandDashboard",value:function(e){var t=localStorage.getItem("blockOuterWidth"),a=e?this.state.blockWidth:t&&parseFloat(t)>39?"35%":t||"25%";this.setState({IsExpandedDashboard:e,blockWidth:a})}},{key:"renderNotFound",value:function(){return(0,P.jsxs)("div",{className:"notFound",children:[(0,P.jsx)("img",{alt:"Stackby logo",src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/landingpage/stackby_logo.png"}),(0,P.jsxs)("div",{className:"notFoundInner",children:[(0,P.jsx)("h3",{children:"The URL youâre reaching is not available."}),(0,P.jsx)("p",{children:"The owner of this stack may have unshared or deleted it. Please reach out to them for access."})]})]})}},{key:"renderEmailDomainRestricted",value:function(){var e=this.state.currentUserLogin;return(0,P.jsxs)("div",{className:"email-restricted",children:[(0,P.jsx)("img",{alt:"Stackby logo",src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/landingpage/stackby_logo.png"}),!e&&(0,P.jsxs)("div",{className:"email-link-header",children:["Please"," ",(0,P.jsxs)("a",{target:"_blank",href:"/login",children:["sign in"," "]}),"to view this content"," "]}),(0,P.jsxs)("div",{className:"email-restricted-inner",children:[(0,P.jsx)("h3",{children:"You do not have permission to view this content"}),(0,P.jsx)("p",{children:"This view is restricted to a specific email domain."})]})]})}},{key:"renderPasswordProtected",value:function(){var e=this,t=this.state,a=(t.currentUserLogin,t.passwordProtectInput),o=t.passwordProtectError;return(0,P.jsxs)("div",{className:"password-protected-main",children:[(0,P.jsx)("img",{alt:"Stackby logo",src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/landingpage/stackby_logo.png"}),(0,P.jsxs)("div",{className:"password-protected-inner",children:[(0,P.jsx)("h3",{children:"A password is required to view this content"}),(0,P.jsx)("p",{children:"This password is not the same as your stackby account password"}),(0,P.jsxs)("div",{className:"password-protected-fill",children:[(0,P.jsxs)(u.A,{className:"input",iconPosition:"left",placeholder:"password",children:[(0,P.jsx)(p.A,{name:"lock"}),(0,P.jsx)("input",{type:"password",value:a,onChange:function(t){return e.setState({passwordProtectInput:t.target.value})},autoFocus:!0,onKeyPress:function(t){return"Enter"==t.key&&e.handlePasswordProtect()}})]}),(0,P.jsx)(m.A,{primary:!0,onClick:function(){return e.handlePasswordProtect()},children:"Enter"})]}),o&&(0,P.jsx)("div",{className:"error-msg",children:o})]})]})}},{key:"handleGleapClose",value:function(e){window.Gleap.close(),Gleap.hide(),window.Gleap.destroy()}},{key:"render",value:function(){var e=this,t=this.props.table,a=t.color,o=(t.info,t.icon,t.color),n=t.stackName,s=t.lastViewId,r=t.viewsData,i=void 0===r?[]:r,l=t.trialPeriodExpire,c=t.plan,u=t.columnSchema,m=t.isExpandValidate,f=t.allStackList,w=void 0===f?{}:f,v=t.isShowViewSection,y=i.find(function(e){return e.viewId===s})||{},k=-2,x=this.state,C=x.stackId,j=x.loading,D=x.fetching,T=x.showChangeRowDataSize,A=x.showCustomizedCardsModel,R=x.searchArray,E=x.searchArrayIndex,N=x.showColumnSelectModel,L=x.showColumnNamesInCards,M=x.cardCoverImageColumnId,B=x.cardFooterSelectorColumnId,F=x.searchValue,O=x.startRange,V=x.endRange,W=x.viewSelectedColumnId,_=x.rowData,H=x.expandView,U=x.IsExpandedDashboard,G=x.blockWidth,J=x.persent,Y=x.isShowCustomDashboardEmbed,q=x.isMobile,Q=x.isHideHeader,X=void 0!==Q&&Q,$=x.isHideApps,Z=void 0!==$&&$,ee=x.cardCoverGalleryImageColumnId,te=x.notfound,ae=x.isView,oe=x.showUseThisData,ne=x.currentUserLogin,se=x.isEmailDomainRestricted,re=x.passwordSession,ie=x.layout,le=x.viewControls,Se=x.viewSectionWidth,xe=x.selectedRow,Ce=x.selectButtonBlockId,Ie=x.showAddMoreButton,je=x.isCopyLinkToColumnOrigin,De=x.colorType,Te=x.colorCondition,Ae=x.colorSelectedColumnId,Re=t.groupByRowData&&t.groupByRowData.length>0&&ke(t,t.groupByRowData)||(_||[]).filter(function(e){return e}),Ee=!1;return ae&&1==t.isAllowCopy&&(Ee=!0),window.Gleap&&this.handleGleapClose(),re?(0,P.jsx)("div",{className:"embed",children:(0,P.jsx)("div",{style:{display:"flex",alignItems:"center",height:"90vh",justifyContent:"center"},children:this.renderPasswordProtected()})}):te?(0,P.jsx)("div",{className:"embed",children:(0,P.jsx)("div",{style:{display:"flex",alignItems:"center",height:"90vh",justifyContent:"center"},children:se?this.renderEmailDomainRestricted():this.renderNotFound()})}):(0,P.jsxs)("div",{className:"embed",children:[j||!_?(0,P.jsx)("div",{style:{display:"flex",alignItems:"center",height:"90vh",justifyContent:"center"},children:te?se?this.renderEmailDomainRestricted():this.renderNotFound():(0,P.jsx)("img",{src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/landingpage/stack_loader.gif",width:"50px"})}):(0,P.jsx)("div",{children:(0,P.jsx)("div",{id:"dashboard",className:"flex align-center",children:(0,P.jsxs)("div",{style:{width:"100%"},children:[(0,P.jsxs)("div",{id:"head",className:"colored-background ","data-color":"white",children:[!X&&w[C]&&(0,P.jsxs)("div",{id:"topbar",className:"flex items-center",style:{backgroundColor:"#fff",boxShadow:ae?"rgba(0, 0, 0, 0.1) 0px 1px 0px 0px":"none"},children:[(0,P.jsxs)("div",{className:"flex items-center items",children:[!ae&&(0,P.jsx)("p",{className:"logo-brand stronger embed-stackname",style:{fontWeight:"500",color:"#000"},children:n}),ae&&(0,P.jsx)("p",{className:"logo-brand stronger",style:{fontWeight:"500",color:"#000"},children:y.name}),!ae&&0!=this.props.table.canCopyPasteFromShareLink&&(0,P.jsxs)("a",{className:"right-menu",href:"/dashboard/?copyStackFromShare="+this.props.table.stackId,target:"_blank",style:{fontWeight:"400",color:"#000",margin:"3px 8px 0px 20px"},children:[(0,P.jsx)(p.A,{name:"copy"})," ",!q&&"Copy Stack"]})]}),(0,P.jsx)("div",{ref:this.setWrapperRef,className:"flex items-center items brand-name",children:!ae&&(0,P.jsx)("img",{src:g,style:{width:"100px"},alt:"Stackby"})}),(0,P.jsxs)("div",{id:"navConfig",style:{justifyContent:"flex-end",position:"absolute",right:0},children:[Ee&&!q&&(0,P.jsx)("div",{className:"flex center invite share-btn-div",onClick:function(){ne?e.setState({showUseThisData:!0}):e.props.history.push("/login")},style:{marginRight:"17px"},children:(0,P.jsx)("p",{className:"sharebtn",style:{color:"#000"},children:"Use this Data"})}),q&&(0,P.jsx)("div",{className:"flex center invite share-btn-div",style:{marginRight:["local","development"].includes("production")?"10px":"8px"},children:(0,P.jsx)("a",{className:"sharebtn",href:"/signup",target:"_blank",style:{color:"black"},children:"Signup"})})]})]}),!ae&&w[C]&&(0,P.jsx)(de,{isView:ae,isHideApps:Z,stackId:C,accessType:k,changeLastTable:this.changeLastTable,isShowCustomDashboardOpen:function(){e.setState({isShowCustomDashboardEmbed:!Y,IsExpandedDashboard:!1}),e.showDashboard()},isShowCustomDashboardEmbed:Y,blockOuterWidth:this.state.blockWidth,IsExpandedDashboard:U,isAppExpanded:this.state.isAppExpanded,isEmbed:!0})]}),(0,P.jsxs)("div",{style:{display:"flex"},children:[(0,P.jsxs)("div",{style:{width:Y?"calc(100% - "+G+")":"100%"},children:[!D&&le?(0,P.jsx)(he,{rowData:_,viewData:y,stackId:C,startRange:O,endRange:V,startRangeColumnId:this.state.startRangeColumnId,endRangeColumnId:this.state.endRangeColumnId,searchValue:F,searchArray:R,showColumnSelectModel:N,viewSelectedColumnId:W,searchArrayIndex:E,showChangeRowDataSize:T,showCustomizedCardsModel:A,_showCustomizedCardsModel:this._showCustomizedCardsModel,handleSearchChange:this.handleSearchChange,onClickSearchButton:this.onClickSearchButton,setParentCompState:this.setParentCompState,embed:!0,isView:ae,isMobile:q,layout:ie,viewSectionWidth:Se}):(0,P.jsx)("div",{id:"toolbar_loading"}),v&&(0,P.jsx)("div",{style:{width:Se,position:"fixed",zIndex:5,backgroundColor:"white"},children:(0,P.jsx)(d.p,{id:"viewSectionId",className:"blocks appPortion ".concat(" max-width-change"),disableDragging:!0,enableResizing:{right:!0,left:!0},minWidth:"200",maxWidth:"350",style:{backgroundColor:"white",borderRight:"1px solid #C5C5C5"},size:{width:Se,height:"calc(100vh - 89px )",transform:"none",left:"unset",top:"auto"},onResize:function(t,a,o,n,s){e.setState({viewSectionWidth:o.style.width},function(){localStorage.setItem("viewSectionWidth",o.style.width)})},children:(0,P.jsx)(b.A,{className:"block-drag-icon",icon:"ios-more",fontSize:"24px",color:"white"})})}),D?(0,P.jsx)(I.A,{}):function(){switch(y.type){case"grid":return q||"card"==ie?(0,P.jsx)(ce,{stackId:C,viewData:y,rowData:_,accessType:k,embed:!0,isHideHeader:X,isView:ae,viewControl
2s:le,layout:ie,viewSectionWidth:Se}):(0,P.jsx)(me,{frozonColumn:"string"==typeof y.frozenColumnCount?parseInt(y.frozenColumnCount):y.frozenColumnCount,rowData:Re,viewData:y,changeFieldType:e.changeFieldType,table:e.props.table,updateMetadata:e.updateMetadata,stackId:C,searchArray:R,searchArrayIndex:E,urlPath:e.props.location.pathname,embed:!0,isHideHeader:X,isView:ae,viewControls:le,viewSectionWidth:Se,showDashboardForButtonColumnClick:e.showDashboardForButtonColumnClick,selectButtonBlockId:Ce,showAddMoreButton:Ie,isCopyLinkToColumnOrigin:je,colorType:De,colorCondition:Te,colorSelectedColumnId:Ae});case"kanban":return(0,P.jsx)(we,{stackId:C,rowData:_,startRange:e.state.startRange,endRange:e.state.endRange,incEndRangeForAddRecordInKanban:e.incEndRangeForAddRecordInKanban,viewData:y,showColumnSelectModel:N,showColumnNamesInCards:L,handleshowColumnSelectModel:e.handleshowColumnSelectModel,cardCoverImageColumnId:M,cardFooterSelectorColumnId:B,changeFieldType:e.changeFieldType,embed:!0,isView:ae,isHideHeader:X,searchArray:R,searchArrayIndex:E,viewSectionWidth:Se,colorType:De,colorCondition:Te,colorSelectedColumnId:Ae});case"list":return q||"card"==ie?(0,P.jsx)(ce,{stackId:C,viewData:y,rowData:_,accessType:k,embed:!0,isHideHeader:X,isView:ae,viewControls:le,layout:ie,viewSectionWidth:Se}):(0,P.jsx)(be,{colorCondition:Te,rowData:_,viewData:y,table:t,stackId:C,searchArray:R,searchArrayIndex:E,accessType:k,viewSectionWidth:Se,colorSelectedColumnId:Ae,colorType:De,embed:!0});case"calendar":return(0,P.jsx)(ge,{stackId:C,rowData:_,startRange:e.state.startRange,endRange:e.state.endRange,viewData:y,showColumnSelectModel:N,handleshowColumnSelectModel:e.handleshowColumnSelectModel,embed:!0,viewSectionWidth:Se,colorType:De,colorCondition:Te,colorSelectedColumnId:Ae});case"form":return(0,P.jsx)(ue,{stackId:C,viewData:y,rowData:_,changeFieldType:e.changeFieldType,accessType:k,embed:!0,isHideHeader:X,viewSectionWidth:Se});case"update":return(0,P.jsx)(pe,{stackId:C,viewData:y,rowData:_,changeFieldType:e.changeFieldType,accessType:k,embed:!0,isHideHeader:X,viewSectionWidth:Se});case"gallery":return(0,P.jsx)(ye,{stackId:C,rowData:_,startRange:e.state.startRange,endRange:e.state.endRange,incEndRangeForAddRecordInKanban:e.incEndRangeForAddRecordInKanban,viewData:y,embed:!0,showColumnSelectModel:N,showColumnNamesInCards:L,cardCoverGalleryImageColumnId:ee,cardFooterSelectorColumnId:B,changeFieldType:e.changeFieldType,accessType:k,searchArray:R,searchArrayIndex:E,viewSectionWidth:Se,colorType:De,colorCondition:Te,colorSelectedColumnId:Ae});case"card":return(0,P.jsx)(ce,{stackId:C,viewData:y,rowData:_,accessType:k,embed:!0,isHideHeader:X,isView:ae,viewControls:le,layout:ie,viewSectionWidth:Se});case"timeline":return(0,P.jsx)(fe,{rowData:_,stackId:C,viewData:y,colorType:De,colorCondition:Te,colorSelectedColumnId:Ae,viewSectionWidth:Se,accessType:k,stackColor:a,searchArray:R,searchArrayIndex:E,embed:!0,isHideHeader:X,isView:ae});default:return(0,P.jsx)("p",{style:{margin:20},children:"Select View"})}}()]}),Y&&(0,P.jsxs)(d.p,{id:"blockdiv",className:"blocks\n embed-blocks ".concat(X?"hideheader-blocks":""," \n ").concat(U?" max-width-change":""),style:{background:"#fff",position:"absolute",height:"calc(99vh - 81px)",right:0,top:"auto",transform:"none",width:"-webkit-fill-available",zIndex:this.state.isAppExpanded?"":"7",borderLeft:U?"":"8px solid ".concat(o)},enableResizing:{right:!1,left:!0},minWidth:"25%",maxWidth:J+"%",size:{width:G,height:"calc(100vh - 89px )",transform:"none",left:"unset"},onResize:function(t,a,o,n,s){e.setState({blockWidth:o.style.width},function(){localStorage.setItem("blockOuterWidth",o.style.width)})},children:[(0,P.jsx)(K.A,{close:function(){e.setState({isShowCustomDashboardEmbed:!1,showBlockModal:!1,blockType:null,selectedBlockId:null})},rowData:_,IsExpandedDashboard:U,columnSchema:u,handleRedirectToaccount:this.handleRedirectToaccount,handleExpandDashboard:this.handleExpandDashboard,showDashboard:this.showDashboard,containerWidth:G,accessType:k,trialPeriodExpire:l,plan:c,isEmbed:!0,isHideHeader:X,viewSectionWidth:Se,isAppExpanded:this.state.isAppExpanded,handleExpandParticularApp:function(t){return e.setState({isAppExpanded:t})},showDashboardForButtonColumnClick:this.showDashboardForButtonColumnClick,selectedRow:xe,selectButtonBlockId:Ce,showBlockModal:this.state.showBlockModal,showAddMoreButton:this.showAddMoreButton,selectedBlockId:this.state.selectedBlockId}),(0,P.jsx)(b.A,{className:"block-drag-icon",icon:"ios-more",fontSize:"24px",color:"white"})]})]}),(0,P.jsxs)("div",{className:"embed-footer",children:[!q&&(0,P.jsx)("a",{target:"_blank",href:"https://stackby.com/?utm_source=stackby_embed",children:(0,P.jsx)("img",{src:S,style:{width:"18px",height:"18px"},alt:"Stackby_logo"})}),!this.props.isView&&q&&(0,P.jsx)("div",{className:"flex items-center",children:(0,P.jsx)("a",{target:"_blank",href:"https://stackby.com/?utm_source=stackby_embed",children:(0,P.jsx)("img",{src:S,style:{width:"18px",height:"18px"},alt:"Stackby_logo"})})}),(0,P.jsxs)("div",{style:{justifyContent:"flex-end",position:"absolute",right:0,color:""},children:[!ae&&0!=this.props.table.canCopyPasteFromShareLink&&(0,P.jsxs)("a",{href:"/dashboard/?copyStackFromShare="+this.props.table.stackId,target:"_blank",style:{fontWeight:"400",color:"#555",margin:"0px 8px 0px 20px"},children:[(0,P.jsx)(p.A,{name:"copy"})," ",!q&&"Copy Stack"]}),y&&"1"==y.isAllowCopy&&(0,P.jsxs)("span",{onClick:this.convertCSV,style:{margin:"0px 8px 0px 8px",color:"#555",cursor:"pointer"},children:[(0,P.jsx)(p.A,{name:"arrow alternate circle down outline",fontSize:"16px",color:"#212121"}),!q&&" Download CSV"]}),"0"==m&&X&&Z&&ie?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&isHideHeader=true&isHideApps=true&layout=card"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"==m&&X&&Z?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&isHideHeader=true&isHideApps=true"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"==m&&Z&&ie?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&isHideApps=true&layout=card"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"==m&&X&&ie?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?isHideHeader=true&layout=card"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"==m&&ie&&!le?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&layout=true&viewControl
2s=false"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"==m&&X?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&isHideHeader=true"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"!=m||le?"0"==m&&Z?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&isHideApps=true"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"==m&&ie?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&layout=true"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):"0"==m&&X?(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&isHideHeader=true"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):(0,P.jsxs)("a",{className:"expand-show",href:"/embed/"+this.props.match.params.stackId,target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]}):(0,P.jsxs)("a",{className:"expand-show",href:"".concat(this.props.match.params.stackId,"?&viewControls=false"),target:"_blank",style:{margin:"0px 8px 0px 8px",color:"#555"},children:[(0,P.jsx)(p.A,{name:"arrows alternate vertical",style:{transform:"rotate(45deg)"}})," ",!q&&"Expand"]})]})]})]})})}),H.length>0&&H.map(function(t,a){return(0,P.jsx)(ve,{openLinkExpandView:e.openLinkExpandView,openLinkPopup:e.openLinkPopup,accessType:k,commentId:e.props.location.pathname.split("/")[5]||"",childId:a,isEmbed:!0,expandView:t,openAttachment:e.openAttachment,viewData:y,filterRowData:_,stackId:C,rowData:_,changeFieldType:e.changeFieldType,updateMetadata:e.updateMetadata,showDashboardForButtonColumnClick:e.showDashboardForButtonColumnClick,handleExpandParticularApp:function(t){return e.setState({isAppExpanded:t})},showAddMoreButton:e.showAddMoreButton},a)}),oe&&(0,P.jsx)(z,{close:function(){return e.setState({showUseThisData:!1})},copyStackId:this.props.table.stackId,copyTableId:this.props.table.lastTableId,viewName:y.name,shareId:y.viewshareId,selectedView:y}),(0,P.jsx)(h.N9,{autoClose:4e3,className:"custom-notification",hideProgressBar:!0,icon:!1})]})}}],s&&te(a.prototype,s),r&&te(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,s,r,i,l}(r().Component),Ce={fetchTable:C.GQ,addToSocketRoom:C.n4,changeLastTable:C.j8,updateRowHeight:C.rO,updateColumnConfig:C.Q5,openExpandView:C.Mh,closeExpandView:C.se,fetchAllStackList:C.qX,removeSortFiltersViewEmbed:C.OP,updateGroupByRowData:C.iJ,showViewSectionAction:C.e5,fetchDashboardList:x.lq,adminActionCreate:C.WX};const Ie=(0,c.Ng)(function(e){return{socket:e.socket,table:e.table,dashboard:e.dashboard}},Ce)((0,Y.A)(xe))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.