/* Minification failed. Returning unminified contents.
(1,696-697): run-time error JS1014: Invalid character: `
(1,707-708): run-time error JS5008: Illegal assignment: =
(1,734-735): run-time error JS1014: Invalid character: `
(1,1230-1238): run-time error JS1004: Expected ';': function
(1,1304-1305): run-time error JS1004: Expected ';': n
(1,1328-1329): run-time error JS1004: Expected ';': i
(1,1467-1468): run-time error JS1004: Expected ';': i
(1,2138-2139): run-time error JS1014: Invalid character: `
(2,13-14): run-time error JS1195: Expected expression: <
(3,13-14): run-time error JS1014: Invalid character: `
(3,73-74): run-time error JS1002: Syntax error: }
(3,97-98): run-time error JS1195: Expected expression: )
(3,98-99): run-time error JS1004: Expected ';': {
(3,430-438): run-time error JS1004: Expected ';': function
(3,501-502): run-time error JS1014: Invalid character: `
(3,527-528): run-time error JS1014: Invalid character: `
(3,531-532): run-time error JS1014: Invalid character: `
(3,532-533): run-time error JS1195: Expected expression: ?
(3,567-568): run-time error JS1195: Expected expression: &
(3,594-595): run-time error JS1014: Invalid character: `
(3,596-597): run-time error JS1014: Invalid character: `
(3,597-598): run-time error JS1195: Expected expression: &
(3,628-629): run-time error JS1195: Expected expression: &
(3,640-641): run-time error JS1197: Too many errors. The file might not be a JavaScript file: $
(3,430-441): run-time error JS1301: End of file encountered before function is properly closed: function(n)
(3,663-664): run-time error JS1195: Expected expression: &
(3,664-675): run-time error JS1197: Too many errors. The file might not be a JavaScript file: ChannelType
 */
+function(n){var t=n.ContractFX=n.ContractFX||{};t.Controls=t.Controls||{};t.Controls.ERFx=t.Controls.ERFx||{};t.Controls.ERFx.ShoppingItemsGrid=t.Controls.ERFx.ShoppingItemsGrid||{};t.Controls.ERFx.ShoppingItemsGrid.GridView=function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b){let k=this;k.ClientInstanceName=n;k.EntityID=t;k.EntityType=i;k.ChannelType=r;k.PageSize=u;k.CurrentPage=w;k.ClientID=f;k.InitOnPageLoad=e;k.SelectedIDs=o&&Array.isArray(o)?o:[];k.SelectionMode=s;k.IsCommandCellVisible=h;k.DeletedItemsOnly=c;k.IsActive=l;k.PublicView=a;k.VisibleCommanButtons=v;k.SearchText=y;k.RunSelect=p;k.HeaderID=0;k.IsShowNotSubmitted=b;k.DataGrid=null;k.DocumentGridContainer=document.querySelector(`[grid-view="${k.ClientInstanceName}"]`);k.GetNodeElementsFromString=function(n){var t=document.createElement("div");return t.innerHTML=n,t.firstElementChild};k.OnInitCompleted=function(){};k.OnEditCommandButtonClick=function(){};k.OnDeleteCommandButtonClick=function(){};k.OnCopyCommandButtonClick=function(){};k.OnRestoreCommandButtonClick=function(){};k.OnHardDeleteCommandButtonClick=function(){};k.OnSelectionChanged=function(){};k.onContentReady=function(){};k.OnPinToTopCommandButtonClick=function(){};k.HandleFetchAsync=async function(n,t){typeof loading!="undefined"&&loading.Show();try{let i=await n;if(!i.ok){let n=await i.json();throw{response:i,errorData:n};}if(t)return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!0,message:""};let r=await i.json();return typeof loading!="undefined"&&loading.Hide(),{data:r,isOk:!0,message:r.ResponseMessage?r.ResponseMessage:null}}catch(i){return i&&i.response&&i.errorData&&i.response.status==400&&i.errorData&&i.errorData.Message?(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:i.errorData.Message?i.errorData.Message:null}):(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Can't receive data from server. Please Contact Us and report a problem."})}return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Please Contact Us and report a problem."}};k.Template=`
            <div gridContainer="${k.ClientInstanceName}"> </div>
            `;k.Node=k.GetNodeElementsFromString(k.Template);k.Request={};k.GetRequest=function(){k.Request={SearchText:k.SearchText,SortBy:1,EntityID:k.EntityID,EntityType:k.EntityType,ChannelType:k.ChannelType,PageSize:k.PageSize,CurrentPage:k.CurrentPage,ClientID:k.ClientID,IsDeleted:k.DeletedItemsOnly,HeaderID:k.HeaderID,IsActive:k.IsActive,PublicView:k.PublicView,IsShowNotSubmitted:k.IsShowNotSubmitted}};k.GetData=async function(n){let i={ShoppingItems:[],TotalCount:0};k.GetRequest();let r=`/api/ShoppingItems/search`,u=`?SearchText=${k.Request.SearchText}&SortBy=${k.Request.SortBy}`+`&EntityID=${k.Request.EntityID}&EntityType=${k.Request.EntityType}&ChannelType=${k.ChannelType}`+`&HeaderID=${k.Request.HeaderID}`+`&PageSize=${k.Request.PageSize}&CurrentPage=${k.Request.CurrentPage}&ClientID=${k.Request.ClientID}&IsDeleted=${k.Request.IsDeleted}`+`&IsActive=${k.Request.IsActive}&PublicView=${k.Request.PublicView}&IsShowNotSubmitted=${k.Request.IsShowNotSubmitted}`,f=`${r}${u}`,t=await k.HandleFetchAsync(fetch(f),!1);t.isOk&&(i=t.data);t.message&&k12Popup.Alert(t.message);n.resolve({data:i.ShoppingItems,totalCount:i.TotalCount})};k.GetDataIDs=async function(n){let t={IDs:[]};k.GetRequest();let r=`/api/ShoppingItems/searchIDs`,u=`?SearchText=${k.Request.SearchText}&SortBy=${k.Request.SortBy}`+`&EntityID=${k.Request.EntityID}&EntityType=${k.Request.EntityType}&ChannelType=${k.Request.ChannelType}`+`&HeaderID=${k.Request.HeaderID}`+`&PageSize=${0}&CurrentPage=${0}&ClientID=${k.Request.ClientID}&IsDeleted=${k.Request.IsDeleted}`+`&IsActive=${k.Request.IsActive}&PublicView=${k.Request.PublicView}&IsShowNotSubmitted=${k.Request.IsShowNotSubmitted}`,f=`${r}${u}`,i=await k.HandleFetchAsync(fetch(f),!1);i.isOk&&(t=i.data);i.message&&k12Popup.Alert(i.message);t.IDs=t.IDs.map(function(n){return{ID:n}});n.resolve({data:t.IDs,totalCount:t.TotalCount})};k.Store=new DevExpress.data.CustomStore({key:"ID",load:function(n){n.skip||(n.skip=0);n.take||(n.take=k.PageSize);let t=0;(n.skip!=0||n.take!=0)&&(t=n.skip/n.take+1,(!t||isNaN(t))&&(t=0));k.PageSize=n.take;k.CurrentPage=t;let i=$.Deferred();return n.filter&&Array.isArray(n.filter)?k.GetDataIDs(i):n.filter||n.select||n.searchOperation||n.searchValue||n.sort?k.GetData(i):k.GetDataIDs(i),i.promise()}});k.DataSource=new DevExpress.data.DataSource({store:k.Store,onLoadError:function(n){console.log(n.message)}});k.PinToTop=`<div><svg xmlns="http://www.w3.org/2000/svg" width="23.977" height="24" viewBox="0 0 23.977 24">
            <path id="pin" d="M21,18.75l3,5.227-5.25-3-.023-.141-3.937-3.914-3.563,3.539q-.985.985-2.227-.235v-4.2L2.953,9.75l-.3.281a1.446,1.446,0,0,1-1.09.469,1.5,1.5,0,0,1-1.1-.457A1.5,1.5,0,0,1,0,8.941,1.559,1.559,0,0,1,.445,7.828L7.851.445A1.561,1.561,0,0,1,8.965,0a1.52,1.52,0,0,1,1.1.445,1.466,1.466,0,0,1,.457,1.09,1.517,1.517,0,0,1-.469,1.113l-.3.3L16.055,9l4.2.023q1.219,1.219.211,2.2l-3.539,3.539L20.859,18.7Z" transform="translate(23.977) rotate(90)" fill="#ccc" />
            </svg >`;k.PinFromTop=`<div style="background:#ccc;"><svg xmlns="http://www.w3.org/2000/svg" width="23.977" height="24" viewBox="0 0 23.977 24">
            <path id="pin" d="M21,18.75l3,5.227-5.25-3-.023-.141-3.937-3.914-3.563,3.539q-.985.985-2.227-.235v-4.2L2.953,9.75l-.3.281a1.446,1.446,0,0,1-1.09.469,1.5,1.5,0,0,1-1.1-.457A1.5,1.5,0,0,1,0,8.941,1.559,1.559,0,0,1,.445,7.828L7.851.445A1.561,1.561,0,0,1,8.965,0a1.52,1.52,0,0,1,1.1.445,1.466,1.466,0,0,1,.457,1.09,1.517,1.517,0,0,1-.469,1.113l-.3.3L16.055,9l4.2.023q1.219,1.219.211,2.2l-3.539,3.539L20.859,18.7Z" transform="translate(23.977) rotate(90)" fill="#fff" />
            </svg >`;k.InitMainSetting=function(n,t){k.EntityID=n;k.EntityType=t};k.Init=function(){return k.SearchText="",new Promise(function(n){k.DocumentGridContainer.innerHTML="";k.DocumentGridContainer.appendChild(k.Node);k.DataGrid=$(k.Node).dxDataGrid({dataSource:k.DataSource,remoteOperations:{groupPaging:!0},wordWrapEnabled:!0,columnHidingEnabled:!0,columnAutoWidth:!0,showColumnLines:!1,showRowLines:!0,showBorders:!0,height:"100%",pager:{showInfo:!0,showNavigationButtons:!0,visible:!0},paging:{pageSize:k.PageSize,pageIndex:k.CurrentPage==0?0:k.CurrentPage-1},selection:{showCheckBoxesMode:"always",selectAllMode:"allPages",mode:k.SelectionMode},columns:[{caption:"",type:"buttons",cellTemplate:function(n,t){return $(`<div class="div-cell-container">`).append($("<div>").dxButton({text:"",hint:"CLONE ITEM",stylingMode:"contained",icon:"copy",disabled:!1,visible:k.VisibleCommanButtons.includes("copy"),onClick:function(){k.OnCopyCommandButtonClick(t.data.ID)}}),$("<div>").dxButton({text:"",hint:"EDIT ITEM",stylingMode:"contained",icon:"edit",disabled:!1,visible:k.VisibleCommanButtons.includes("edit"),onClick:function(){k.OnEditCommandButtonClick(t.data.ID)}}),$("<div>").dxButton({text:"",hint:"MOVE ITEM TO RECYCLE BIN",stylingMode:"contained",icon:"trash",visible:k.VisibleCommanButtons.includes("trash"),disabled:!1,onClick:function(){k.OnDeleteCommandButtonClick(t.data.ID)}}),$("<div>").dxButton({text:"",hint:"RESTORE ITEM FROM RECYCLE BIN",stylingMode:"contained",icon:"undo",visible:k.VisibleCommanButtons.includes("undo"),disabled:!1,onClick:function(){k.OnRestoreCommandButtonClick(t.data.ID)}}),$("<div>").dxButton({text:"",hint:"PERMANENTLY DELETE ITEM",stylingMode:"contained",icon:"clearsquare",disabled:!1,visible:k.VisibleCommanButtons.includes("clearsquare"),onClick:function(){k.OnHardDeleteCommandButtonClick(t.data.ID)}}))},visible:k.IsCommandCellVisible},{caption:"",type:"buttons",cellTemplate:function(n,t){return $(`<div class="div-cell-container">`).append($(t.data.PinnedInTop?k.PinFromTop:k.PinToTop).dxButton({text:"",hint:t.data.PinnedInTop?"Unpin item":"Pin to top",stylingMode:"contained",disabled:!1,onClick:function(){k.OnPinToTopCommandButtonClick(t.data.ID,k.EntityID,k.EntityType,!t.data.PinnedInTop)}}))},visible:k.VisibleCommanButtons.includes("pintotop"),width:80},{caption:"Item Name",calculateCellValue:function(n){return`
                            <div class="div-cell-container">
                                <div>
                                ${n.NameViewString}
                                </div>
                            </div>
                            `},encodeHtml:!1,alignment:"center",width:150},{caption:"Item Number",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                    ${n.NumberViewString}
                                    </div>   
                                </div>
                                `},encodeHtml:!1,alignment:"center",width:150},{caption:"Description",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                        ${n.DescriptionViewString}
                                    </div>
                                </div>
                                `},encodeHtml:!1,alignment:"center",width:200},{caption:"Status",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                        ${n.ActiveFlag}
                                    <div>
                                </div>
                                `},encodeHtml:!1,alignment:"center",width:100},{caption:"Category Code",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                    ${n.CategoryCode}    
                                    </div>
                                </div>
                                `},encodeHtml:!1,alignment:"center",width:150},{caption:"Main Photo",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div class="div-main-photo" style="background-image: url(${n.MainPhotoUrl});">
                                    </div>
                                </div>
                                `},encodeHtml:!1,alignment:"center"},{caption:"Qty Available",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                        ${n.QtyString}
                                    </div>
                                </div>
                                `},encodeHtml:!1,alignment:"center"},{caption:"Unit Price",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                        ${n.UnitPriceString}
                                    </div>
                                </div>
                                `},encodeHtml:!1,alignment:"center"},{caption:"Shipping",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                        ${n.ShippingHandlingTypeViewString}
                                    </div>
                                </div>
                                `},encodeHtml:!1,alignment:"center"},{caption:"Returns",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                        ${n.ReturnViewString}
                                    <div>
                                </div>
                                `},encodeHtml:!1,alignment:"center"},{caption:"Catalog Name",calculateCellValue:function(n){return`
                                <div class="div-cell-container">
                                    <div>
                                        ${n.CatalogNameViewString}
                                    <div>
                                </div>
                                `},encodeHtml:!1,alignment:"center"},],onSelectionChanged:function(){k.SelectedIDs=k.DataGrid.getSelectedRowKeys();k.OnSelectionChanged(k.SelectedIDs)},onRowClick:function(n){k.DataGrid.isRowSelected(n.data.ID)?k.DataGrid.deselectRows(n.data.ID):k.DataGrid.selectRows(n.data.ID,!0)},onInitialized:function(){}}).dxDataGrid("instance");k.DataGrid.option("onContentReady",function(){k.RunSelect?(k.DataGrid&&Array.isArray(k.SelectedIDs)&&k.SelectedIDs.length>0?k.DataGrid.selectRows(k.SelectedIDs).then(function(){k.SelectedIDs=k.DataGrid.getSelectedRowKeys();k.OnSelectionChanged(k.SelectedIDs);k.onContentReady();k.OnInitCompleted();n()}):k.DataGrid.deselectAll().then(function(){k.SelectedIDs=k.DataGrid.getSelectedRowKeys();k.OnSelectionChanged(k.SelectedIDs);k.onContentReady();k.OnInitCompleted();n()}),k.RunSelect=!1):(k.SelectedIDs=k.DataGrid.getSelectedRowKeys(),k.OnSelectionChanged(k.SelectedIDs),k.onContentReady(),k.OnInitCompleted(),n())})})};e&&k.Init()}}(window);;
+function(n){var t=n.ContractFX=n.ContractFX||{};t.Controls=t.Controls||{};t.Controls.ERFx=t.Controls.ERFx||{};t.Controls.ERFx.ShoppingItemsGrid=t.Controls.ERFx.ShoppingItemsGrid||{};t.Controls.ERFx.ShoppingItemsGrid.SearchBar=function(n,t,i,r){let u=this;u.ClientInstanceName=n;u.SearchText=t;u.InitOnPageLoad=i;u.FixedSearchTypeWidth=r;let f=document.forms.length>0?document.forms[0]:!1;f&&f.addEventListener("keydown",function(n){n.keyCode==13&&n.target.tagName=="INPUT"&&n.preventDefault()});u.SearchBarContainer=document.querySelector(`[search-bar="${u.ClientInstanceName}"]`);u.GetNodeElementsFromString=function(n){var t=document.createElement("div");return t.innerHTML=n,t.firstElementChild};u.OnInitCompleted=function(){};u.OnClearClick=function(){};u.OnSearchClick=function(){};u.OnEnterKey=function(){};u.OnSearchTypeChanged=function(){};u.SearchTypes=null;u.Template=`
            <div class="width100 d-flex justify-content-start flex-wrap search-box-max-width">
                <div tbSearchItems="${u.ClientInstanceName}" class="width100"> </div>
                <div sbSearchType="${u.ClientInstanceName}_ddbSearchType" ${u.FixedSearchTypeWidth?'style="width:30%"':""}></div>
            </div>
            `;u.Node=u.GetNodeElementsFromString(u.Template);u.ChangeSeachTypeVisibility=function(n){u.DdbSearchType&&u.DdbSearchType.option("visible",n)};u.Init=function(){return new Promise(function(n){u.SearchBarContainer.innerHTML="";u.SearchBarContainer.appendChild(u.Node);u.TbSearchItems=$("[tbSearchItems]",u.Node).dxTextBox({placeholder:"Search for...",buttons:[{name:"reset",location:"after",options:{hint:"Reset Search",icon:"remove",type:"back",stylingMode:"text",onClick:function(){let n=u.TbSearchItems.option("value");u.TbSearchItems.option("value","");u.OnClearClick()}}},{name:"search",location:"after",options:{hint:"Search",icon:"find",type:"normal",width:80,onClick:function(){let n=u.TbSearchItems.option("value");u.OnSearchClick(n)}}}],onEnterKey:function(n){let t=n.event.currentTarget.value;u.OnEnterKey(t)},onContentReady:function(n){$(n.element).find("input").attr("autocomplete","new");$(n.element).find("input").attr("readonly","");$(n.element).find("input").attr("onfocus","this.removeAttribute('readonly')")},value:u.SearchText}).dxTextBox("instance");u.SearchTypes&&(u.DdbSearchType=$("[sbSearchType]",u.Node).dxSelectBox({dataSource:u.SearchTypes,displayExpr:"Text",valueExpr:"Value",value:u.SearchTypes[0].Value,onValueChanged:function(n){u.OnSearchTypeChanged(n.value)}}).dxSelectBox("instance"));u.OnInitCompleted();n()})};u.InitOnPageLoad&&u.Init()}}(window);;
+function(n){var t=n.ContractFX=n.ContractFX||{};t.Controls=t.Controls||{};t.Controls.ERFx=t.Controls.ERFx||{};t.Controls.ERFx.ItemsToSellGrid=function(n,t,i,r,u,f,e,o,s,h,c,l){let a=this;a.ClientInstanceName=n;a.InitOnPageLoad=t;a.ucItemGridView=i;a.ucItemSearchBar=r;a.EntityID=u;a.EntityType=f;a.SiteName=e;a.IsToolBarVisible=o;a.ucSelectItemsToSellControl=s;a.ucSelectCatalogsToSellControl=h;a.dvxASPxCallback=c;a.LocalStorageSavedStateKey="ItemsToSellGridPage";a.ucShoppingItemsTrashControl=l;a.LocalStorageSavedState=null;a.ToolBarContainer=document.querySelector(`[div-tool-bar="${a.ClientInstanceName}"]`);a.GetNodeElementsFromString=function(n){var t=document.createElement("div");return t.innerHTML=n,t.firstElementChild};a.OnInitCompleted=function(){};a.OnSelectItemsBtnClick=function(){};a.OnSelectCatalogsBtnClick=function(){};a.OnAddNewItemBtnClick=function(){};a.OnRemoveItemsBtnClick=function(){};a.OnEditItemBtnClick=function(){};a.HandleFetchAsync=async function(n,t){typeof loading!="undefined"&&loading.Show();try{let i=await n;if(!i.ok){let n=await i.json();throw{response:i,errorData:n};}if(t)return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!0,message:""};let r=await i.json();return typeof loading!="undefined"&&loading.Hide(),{data:r,isOk:!0,message:r.ResponseMessage?r.ResponseMessage:null}}catch(i){return i&&i.response&&i.errorData&&i.response.status==400&&i.errorData&&i.errorData.Message?(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:i.errorData.Message?i.errorData.Message:null}):(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Can't receive data from server. Please Contact Us and report a problem."})}return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Please Contact Us and report a problem."}};a.RemoveSpecificItemsFromEntity=async function(){let n=`/api/ShoppingItems/RemoveSpecificItemsFromEntity`,t={EntityID:a.EntityID,EntityType:a.EntityType,VendorCatalogIDs:a.ucItemGridView.SelectedIDs},i=fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await a.HandleFetchAsync(i,!0)};a.CheckItemsToUnique=async function(){let n=`/api/ShoppingItems/CheckItemsToUnique`,t={EntityID:a.EntityID,EntityType:a.EntityType,VendorCatalogIDs:a.ucSelectItemsToSellControl.ucGridView.SelectedIDs},i=fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await a.HandleFetchAsync(i,!1)};a.SaveSelected=async function(){let n=`/api/ShoppingItems/SaveSelected`,t={EntityID:a.EntityID,EntityType:a.EntityType,VendorCatalogIDs:a.ucSelectItemsToSellControl.ucGridView.SelectedIDs},i=fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await a.HandleFetchAsync(i,!0)};a.PinToTopItem=async function(n,t,i,r){let u=`/api/ShoppingItems/PinToTopVendorCatalog`,f={Pin:r,VendorCatalogID:n,EntityID:t,EntityType:i},e=fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});return await a.HandleFetchAsync(e,!0)};a.SaveSelectedCatalogs=async function(){let n=`/api/ShoppingCatalogs/SaveSelected`,t={EntityID:a.EntityID,EntityType:a.EntityType,VendorCatalogHeaderIDs:a.ucSelectCatalogsToSellControl.ucGridView.SelectedIDs},i=fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await a.HandleFetchAsync(i,!0)};a.ToolBarWrapperTempalte=`
            <div class="grid-toolbar-wrapper d-flex justify-content-between">
                <div command-buttons="">
                </div>
                <div recycle-bin="" style="margin-right: 5px;">
                </div>
            </div>
            `;a.SelectItemsBtnTempalte=`
            <div class="btn-toolbar-item">
            </div>
            `;a.SelectCatalogsBtnTempalte=`
            <div class="btn-toolbar-item">
            </div>
            `;a.AddNewItemBtnTemplate=`
            <div class="btn-toolbar-item">
            </div>
            `;a.RemoveItemsBtnTemplate=`
            <div class="btn-toolbar-item">
            </div>
            `;a.EditItemBtnTemplate=`
            <div class="btn-toolbar-item">
            </div>
            `;a.ToolBarWrapperNode=a.GetNodeElementsFromString(a.ToolBarWrapperTempalte);a.CommandButtonsContainerNode=a.ToolBarWrapperNode.querySelector("[command-buttons]");a.RecycleBinBtnNode=a.ToolBarWrapperNode.querySelector("[recycle-bin]");a.SelectItemsBtnNode=a.GetNodeElementsFromString(a.SelectItemsBtnTempalte);a.SelectCatalogsBtnNode=a.GetNodeElementsFromString(a.SelectCatalogsBtnTempalte);a.AddNewItemBtnNode=a.GetNodeElementsFromString(a.AddNewItemBtnTemplate);a.RemoveItemsBtnNode=a.GetNodeElementsFromString(a.RemoveItemsBtnTemplate);a.EditItemBtnNode=a.GetNodeElementsFromString(a.EditItemBtnTemplate);a.CommandButtonsContainerNode.appendChild(a.AddNewItemBtnNode);a.CommandButtonsContainerNode.appendChild(a.SelectItemsBtnNode);a.CommandButtonsContainerNode.appendChild(a.SelectCatalogsBtnNode);a.CommandButtonsContainerNode.appendChild(a.EditItemBtnNode);a.CommandButtonsContainerNode.appendChild(a.RemoveItemsBtnNode);a.dvxASPxCallback_BeginCallBack=function(){loading.Show()};a.dvxASPxCallback_EndCallBack=function(){loading.Hide()};a.ucItemSearchBar_OnClearClick=function(){a.ucItemGridView.SearchText="";a.ucItemGridView.DataGrid.pageIndex(0);a.ucItemGridView.DataSource.reload()};a.ucItemSearchBar_OnSearchClick=function(n){a.ucItemGridView.SearchText=n;a.ucItemGridView.DataGrid.pageIndex(0);a.ucItemGridView.DataSource.reload()};a.ucItemSearchBar_OnEnterKey=function(n){a.ucItemGridView.SearchText=n;a.ucItemGridView.DataGrid.pageIndex(0);a.ucItemGridView.DataSource.reload()};a.DataGrid_OnSelectionChanged=function(n){let t=n.selectedRowKeys.length;a.EditItemBtn.option("visible",t>0);a.EditItemBtn.option("disabled",t>1||t==0);a.RemoveItemsBtn.option("visible",t>0)};a.ucSelectItemsToSellControl_OnShowing=function(){a.ucItemGridView.DataGrid.dispose()};a.ucSelectItemsToSellControl_OnHiding=function(){a.Init()};a.SelectItemsBtn_OnClick=function(){a.ucSelectItemsToSellControl.Show()};a.ucSelectItemsToSellControl_OnConfirmClick=async function(){let n=await a.CheckItemsToUnique().then(n=>{let t=`<div class='confirm-text-block'>Do you want to save changes?</div>`;n!=null&&n.data!=null&&n.data.ItemNumbersDuplicated!=null&&n.data.ItemNumbersDuplicated.length>0&&(t=`<div class='confirm-text-block'>An item with same item number already exists, only item with lowest price will show up. Do you want to add item?</div>`);k12PopupEFX.Confirm(t,async function(){let n=await a.SaveSelected();n.message&&k12PopupEFX.Alert(n.message);a.ucSelectItemsToSellControl.Hide()},function(){return})})};a.ucSelectItemsToSellControl_OnCancelClick=function(){k12PopupEFX.Confirm(`<div class="confirm-text-block">Close without Saving?</div>`,function(){a.ucSelectItemsToSellControl.Hide()},function(){return})};a.ucSelectCatalogsToSellControl_OnShowing=function(){a.ucItemGridView.DataGrid.dispose()};a.ucSelectCatalogsToSellControl_OnHiding=function(){a.Init()};a.SelectCatalogsBtn_OnClick=function(){a.ucSelectCatalogsToSellControl.Show()};a.ucSelectCatalogsToSellControl_OnConfirmClick=function(){k12PopupEFX.Confirm(`<div class="confirm-text-block">Do you want to save changes?</div>`,async function(){let n=await a.SaveSelectedCatalogs();n.message&&k12PopupEFX.Alert(n.message);a.ucSelectCatalogsToSellControl.Hide()},function(){return})};a.ucSelectCatalogsToSellControl_OnCancelClick=function(){k12PopupEFX.Confirm(`<div class="confirm-text-block">Close without Saving?</div>`,function(){a.ucSelectCatalogsToSellControl.Hide()},function(){return})};a.OffListeneres=function(){a.ucItemGridView.DataGrid.off("selectionChanged",a.DataGrid_OnSelectionChanged);a.SelectItemsBtn&&a.SelectItemsBtn.off("click",a.SelectItemsBtn_OnClick);a.SelectCatalogsBtn&&a.SelectCatalogsBtn.off("click",a.SelectCatalogsBtn_OnClick)};a.SaveStateInLocalStorage=function(n){let t=JSON.stringify(n);localStorage.setItem(a.LocalStorageSavedStateKey,t)};a.AplySavedLocalStorageState=function(){a.InitSavedLocalState();a.LocalStorageSavedState&&a.LocalStorageSavedState.PageIndex&&a.LocalStorageSavedState.PageIndex>0&&(a.ucItemGridView.PageNumber=a.LocalStorageSavedState.PageIndex+1,a.LocalStorageSavedState=null)};a.InitSavedLocalState=function(){let n=localStorage.getItem(a.LocalStorageSavedStateKey);n&&(localStorage.removeItem(a.LocalStorageSavedStateKey),a.LocalStorageSavedState=JSON.parse(n))};a.InitToolBarButtons=function(){a.ToolBarContainer.innerHTML="";a.ToolBarContainer.appendChild(a.ToolBarWrapperNode);a.TrashBtn=$(a.RecycleBinBtnNode).dxButton({text:"Recycle Bin",hint:"Recycle Bin",stylingMode:"contained",icon:"trash",disabled:!1,onClick:function(){a.ucShoppingItemsTrashControl.Show()}}).dxButton("instance");a.SelectItemsBtn=$(a.SelectItemsBtnNode).dxButton({text:"SELECT FROM ALL ITEMS",hint:"SELECT FROM ALL ITEMS",stylingMode:"contained",icon:"check",disabled:!1,onClick:function(){a.OnSelectItemsBtnClick()}}).dxButton("instance");a.SelectCatalogsBtn=$(a.SelectCatalogsBtnNode).dxButton({text:"SELECT CATALOGS",hint:"SELECT CATALOGS",stylingMode:"contained",icon:"check",disabled:!1,onClick:function(){a.OnSelectCatalogsBtnClick()}}).dxButton("instance");a.AddNewItemBtn=$(a.AddNewItemBtnNode).dxButton({text:"ADD NEW ITEM",hint:"ADD NEW ITEM",stylingMode:"contained",icon:"plus",disabled:!1,onClick:function(){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Do you want to Add new item?
                        </div>
                        <div class="info-text-block">
                        New Item will be automaticlly added to current `+a.GetCurrentEntityStr(!1)+`.
                        </div>
                    </div>`,function(){a.OnAddNewItemBtnClick();a.dvxASPxCallback.PerformCallback("addShoppingItem|"+a.EntityID+"|"+a.EntityType)},function(){return})}}).dxButton("instance");a.RemoveItemsBtn=$(a.RemoveItemsBtnNode).dxButton({text:"REMOVE",hint:"REMOVE",stylingMode:"contained",icon:"minus",visible:a.ucItemGridView.SelectedIDs.length>0,disabled:!1,onClick:function(){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Remove ${a.ucItemGridView.SelectedIDs.length} item(s) from the `+a.GetCurrentEntityStr(!1)+`?
                        </div>
                        <div class="info-text-block">
                        This item(s) will not be deleted from ${a.SiteName} just will not shown for this `+a.GetCurrentEntityStr(!1)+`.
                        </div>
                    </div>`,async function(){if(a.OnRemoveItemsBtnClick(u,f,a.ucItemGridView.SelectedIDs),a.ucItemGridView.SelectedIDs.length>0){let n=await a.RemoveSpecificItemsFromEntity();n.message&&k12PopupEFX.Alert(n.message);a.Init()}},function(){return})}}).dxButton("instance");a.EditItemBtn=$(a.EditItemBtnNode).dxButton({text:"EDIT",hint:"EDIT",stylingMode:"contained",icon:"edit",visible:a.ucItemGridView.SelectedIDs.length>0,disabled:a.ucItemGridView.SelectedIDs.length>1||a.ucItemGridView.SelectedIDs.length==0,onClick:function(){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Do you want to edit this item?
                        </div>
                        <div class="info-text-block">
                        If you will change this item, it will be changed for all `+a.GetCurrentEntityStr(!1)+`s where it exists.
                        </div>
                    </div>`,function(){a.OnEditItemBtnClick(a.ucItemGridView.SelectedIDs);a.SaveStateInLocalStorage({PageIndex:a.ucItemGridView.DataGrid.pageIndex()});a.dvxASPxCallback.PerformCallback("editShoppingItem|"+a.ucItemGridView.SelectedIDs.join(",")+"|"+a.EntityID+"|"+a.EntityType)},function(){return})}}).dxButton("instance")};a.ucGridView_OnPinToTopCommandButtonClick=async function(n,t,i,r){let f=await a.PinToTopItem(n,t,i,r);f.message&&k12PopupEFX.Alert(f.message);a.ucItemGridView.Init();let u=a.ucItemSearchBar.TbSearchItems.option("value");typeof u!="undefined"&&u.trim().length!=0&&(a.ucItemGridView.SearchText=u,a.ucItemGridView.DataSource.reload())};a.BindListeners=function(){if(a.OffListeneres(),a.ucItemSearchBar.OnClearClick=a.ucItemSearchBar_OnClearClick,a.ucItemSearchBar.OnSearchClick=a.ucItemSearchBar_OnSearchClick,a.ucItemSearchBar.OnEnterKey=a.ucItemSearchBar_OnEnterKey,a.ucItemGridView.OnPinToTopCommandButtonClick=a.ucGridView_OnPinToTopCommandButtonClick,a.IsToolBarVisible){a.ucItemGridView.DataGrid.on("selectionChanged",a.DataGrid_OnSelectionChanged);a.SelectItemsBtn.on("click",a.SelectItemsBtn_OnClick);a.ucSelectItemsToSellControl.OnConfirmClick=a.ucSelectItemsToSellControl_OnConfirmClick;a.ucSelectItemsToSellControl.OnCancelClick=a.ucSelectItemsToSellControl_OnCancelClick;a.ucSelectItemsToSellControl.OnShowing=a.ucSelectItemsToSellControl_OnShowing;a.ucSelectItemsToSellControl.OnHiding=a.ucSelectItemsToSellControl_OnHiding;a.SelectCatalogsBtn.on("click",a.SelectCatalogsBtn_OnClick);a.ucSelectCatalogsToSellControl.OnConfirmClick=a.ucSelectCatalogsToSellControl_OnConfirmClick;a.ucSelectCatalogsToSellControl.OnCancelClick=a.ucSelectCatalogsToSellControl_OnCancelClick;a.ucSelectCatalogsToSellControl.OnShowing=a.ucSelectCatalogsToSellControl_OnShowing;a.ucSelectCatalogsToSellControl.OnHiding=a.ucSelectCatalogsToSellControl_OnHiding;a.dvxASPxCallback.BeginCallback.AddHandler(a.dvxASPxCallback_BeginCallBack,a);a.dvxASPxCallback.EndCallback.AddHandler(a.dvxASPxCallback_EndCallBack,a)}};a.GetCurrentEntityStr=function(n){let t="entity";switch(a.EntityType){case"1":case"2":t="video";break;case"3":case"4":t="booth"}return n&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t};a.Dispose=function(){a.ucItemGridView.DataGrid.dispose()};a.InitMainSetting=function(n,t){a.EntityID=n;a.EntityType=t;a.ucItemGridView.InitMainSetting(n,t);a.ucSelectItemsToSellControl.InitMainSetting(n,t);a.ucSelectCatalogsToSellControl.InitMainSetting(n,t);a.ucShoppingItemsTrashControl.InitMainSetting(n,t)};a.Init=function(){return a.AplySavedLocalStorageState(),a.SearchText="",new Promise(function(n){Promise.all([a.ucItemGridView.Init(),a.ucItemSearchBar.Init(),a.ucShoppingItemsTrashControl.Init()]).then(function(){a.IsToolBarVisible&&a.InitToolBarButtons();a.ucItemGridView.PageNumber>1&&(a.ucItemGridView.PageNumber=1);a.BindListeners();a.ucSelectItemsToSellControl.AplySavedLocalStorageState();a.ucSelectCatalogsToSellControl.AplySavedLocalStorageState();a.OnInitCompleted();n()})})};t&&a.Init()}}(window);;
+function(n){var t=n.ContractFX=n.ContractFX||{};t.Controls=t.Controls||{};t.Controls.ERFx=t.Controls.ERFx||{};t.Controls.ERFx.SelectItemsToSellControl=function(n,t,i,r,u,f,e,o,s,h,c){let l=this;l.htmlElTag=document.querySelector("html");l.ClientInstanceName=n;l.InitOnPageLoad=t;l.SearchText="";l.EntityID=u;l.EntityType=f;l.ucGridView=i;l.ucSearchBar=r;l.SiteName=e;l.CallBackWithEditCommand=s;l.ucShoppingItemsTrashControl=h;l.IsShowNotSubmitted=c;l.SelectItemsToSellPopUpContainer=document.querySelector(`[div-select-items-to-sell-pop-up="${l.ClientInstanceName}"]`);l.LocalStorageSavedStateKey="SelectItemsToSellControl";l.LocalStorageSavedState=null;l.ToolBarContainer=document.querySelector(`[div-tool-bar="${l.ClientInstanceName}"]`);l.FooterBarContainer=document.querySelector(`[div-footer-bar="${l.ClientInstanceName}"]`);l.GetNodeElementsFromString=function(n){var t=document.createElement("div");return t.innerHTML=n,t.firstElementChild};l.Show=function(){l.SelectItemsToSellPopUp.show()};l.Hide=function(){l.SelectItemsToSellPopUp.hide()};l.OnShowing=function(){};l.OnHiding=function(){};l.OnInitCompleted=function(){};l.OnTrashButtonClick=function(){};l.OnConfirmClick=function(){};l.OnCancelClick=function(){};l.HandleFetchAsync=async function(n,t){typeof loading!="undefined"&&loading.Show();try{let i=await n;if(!i.ok){let n=await i.json();throw{response:i,errorData:n};}if(t)return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!0,message:""};let r=await i.json();return typeof loading!="undefined"&&loading.Hide(),{data:r,isOk:!0,message:r.ResponseMessage?r.ResponseMessage:null}}catch(i){return i&&i.response&&i.errorData&&i.response.status==400&&i.errorData&&i.errorData.Message?(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:i.errorData.Message?i.errorData.Message:null}):(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Can't receive data from server. Please Contact Us and report a problem."})}return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Please Contact Us and report a problem."}};l.CopyItem=async function(n){let t=`/api/ShoppingItems/CopyVendorCatalog`,i={VendorCatalogID:n},r=fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await l.HandleFetchAsync(r,!0)};l.ChangeStatus=async function(n,t){let i=`/api/ShoppingItems/ChangeDeletedStatus`,r={VendorCatalogID:n,Status:t},u=fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});return await l.HandleFetchAsync(u,!0)};l.Request={};l.GetRequest=function(){l.Request={SearchText:l.SearchText,SortBy:0,EntityID:l.EntityID,EntityType:l.EntityType,FK_Media_Channel:0,ChannelType:-1,PageSize:0,CurrentPage:0,ClientID:0,IsActive:1,IsShowNotSubmitted:c}};l.GetSelectedIdsData=async function(){l.GetRequest();let n=`/api/ShoppingItems/searchIDs`,t=`?SearchText=${l.Request.SearchText}`+`&SortBy=${l.Request.SortBy}&EntityID=${l.Request.EntityID}&EntityType=${l.Request.EntityType}`+`&FK_Media_Channel=${l.Request.FK_Media_Channel}&ChannelType=${l.Request.ChannelType}`+`&PageSize=${l.Request.PageSize}&CurrentPage=${l.Request.CurrentPage}&ClientID=${l.Request.ClientID}&IsActive=${l.Request.IsActive}`+`&IsShowNotSubmitted=${l.Request.IsShowNotSubmitted}`,i=`${n}${t}`,r=fetch(i);return await l.HandleFetchAsync(r,!1)};l.ToolBarWrapperTempalte=`
            <div class="grid-toolbar-wrapper select-items-grid-toolbar">
            </div>
            `;l.FooterBarWrapperTemplate=`
            <div class ="footer-bar-wrapper">
            </div>
            `;l.SelectedItemsCounterTemplate=`
            <div class="d-flex align-items-center selected-items-counter">
                <div>
                You have selected
                </div>
                <div counter-value="" style="margin-left: 4px; font-weight: bold;">
                0
                </div>
                <div style="margin-left: 4px;">
                Item(s)
                </div>
            </div>
            `;l.TrashBtnTemplate=`
            <div>
            </div>
            `;l.CancelBtnTemplate=`
            <div class="btn-toolbar-item">
            </div>
            `;l.ConfirmBtnTemplate=`
            <div class="btn-toolbar-item">
            </div>
            `;l.ToolBarWrapperNode=l.GetNodeElementsFromString(l.ToolBarWrapperTempalte);l.FooterBarWrapperNode=l.GetNodeElementsFromString(l.FooterBarWrapperTemplate);l.SelectedItemsCounterNode=l.GetNodeElementsFromString(l.SelectedItemsCounterTemplate);l.SelectedItemsCounterNode_CounterValueNode=l.SelectedItemsCounterNode.querySelector("[counter-value]");l.ToolBarWrapperNode.appendChild(l.SelectedItemsCounterNode);l.TrashBtnNode=l.GetNodeElementsFromString(l.TrashBtnTemplate);l.ToolBarWrapperNode.appendChild(l.TrashBtnNode);l.CancelBtnNode=l.GetNodeElementsFromString(l.CancelBtnTemplate);l.FooterBarWrapperNode.appendChild(l.CancelBtnNode);l.ConfirmBtnNode=l.GetNodeElementsFromString(l.ConfirmBtnTemplate);l.FooterBarWrapperNode.appendChild(l.ConfirmBtnNode);l.ucGridView_DataGrid_onSelectionChanged=function(n){l.SelectedItemsCounterNode_CounterValueNode.innerHTML=n.selectedRowKeys.length};l.ucGridView_OnEditCommandButtonClick=function(n){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Do you want to edit this item?
                        </div>
                        <div class="info-text-block">
                        If you will change this item, it will be changed for all `+l.GetCurrentEntityStr(!1)+`s where it exists.
                        </div>
                    </div>`,function(){l.SaveStateInLocalStorage({PageIndex:l.ucGridView.DataGrid.pageIndex()});l.CallBackWithEditCommand.PerformCallback("editShoppingItem|"+n)},function(){return})};l.ucGridView_OnDeleteCommandButtonClick=function(n){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Move this item to Recycle Bin?
                        </div>
                        <div class="info-text-block">
                        This item will not be deleted from ${l.SiteName} just will not shown on any of your `+l.GetCurrentEntityStr(!1)+`s.
                        </div>
                    </div>`,async function(){let t=await l.ChangeStatus(n,!0);t.message&&k12PopupEFX.Alert(t.message);l.Init()},function(){return})};l.ucGridView_OnCopyCommandButtonClick=function(n){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Make copy of this Item?
                        </div>
                        <div class="info-text-block">
                        It will be a new item based on this item.<br>
                        Please review copied item. Maybe you should change quantity.
                        </div>
                    </div>`,async function(){let t=await l.CopyItem(n);t.message&&k12PopupEFX.Alert(t.message);l.Init()},function(){return})};l.ucSearchBar_OnClearClick=function(){l.ucGridView.SearchText="";l.ucGridView.DataGrid.pageIndex(0);l.ucGridView.DataSource.reload()};l.ucSearchBar_OnSearchClick=function(n){l.ucGridView.SearchText=n;l.ucGridView.DataGrid.pageIndex(0);l.ucGridView.DataSource.reload()};l.ucSearchBar_OnEnterKey=function(n){l.ucGridView.SearchText=n;l.ucGridView.DataGrid.pageIndex(0);l.ucGridView.DataSource.reload()};l.ucShoppingItemsTrashControl_OnShowing=function(){};l.ucShoppingItemsTrashControl_OnHiding=function(){l.ucShoppingItemsTrashControl.ucGridView.DataGrid.dispose();l.Init()};l.SaveStateInLocalStorage=function(n){let t=JSON.stringify(n);localStorage.setItem(l.LocalStorageSavedStateKey,t)};l.AplySavedLocalStorageState=function(){l.InitSavedLocalState();l.LocalStorageSavedState&&l.LocalStorageSavedState.PageIndex>-1&&(l.ucGridView.PageNumber=l.LocalStorageSavedState.PageIndex+1,l.Show(),l.LocalStorageSavedState=null)};l.InitSavedLocalState=function(){let n=localStorage.getItem(l.LocalStorageSavedStateKey);n&&(localStorage.removeItem(l.LocalStorageSavedStateKey),l.LocalStorageSavedState=JSON.parse(n))};l.InitSelectItemsToSellPopUp=function(){l.SelectItemsToSellPopUp=$(l.SelectItemsToSellPopUpContainer).dxPopup({fullScreen:!0,title:`Select Items to Sell`,dragEnabled:!1,onShowing:function(){l.OnShowing();l.htmlElTag.classList.add("overfolw-hidden-important");l.Init()},onHiding:function(){l.OnHiding();l.ucGridView.DataGrid.dispose();l.SearchText="";l.ucGridView.SearchText="";l.htmlElTag.classList.remove("overfolw-hidden-important")}}).dxPopup("instance")};l.InitSelectItemsFromCatalogToSellPopUp=function(){l.SelectItemsToSellPopUp=$(l.SelectItemsToSellPopUpContainer).dxPopup({fullScreen:!0,title:`Select Catalog Items to Sell`,dragEnabled:!1,onShowing:function(){l.OnShowing();l.htmlElTag.classList.add("overfolw-hidden-important");l.Init()},onHiding:function(){l.OnHiding();l.ucGridView.DataGrid.dispose();l.htmlElTag.classList.remove("overfolw-hidden-important")}}).dxPopup("instance")};l.InitToolBar=function(){l.ToolBarContainer.innerHTML="";l.ToolBarContainer.appendChild(l.ToolBarWrapperNode);l.TrashBtn=$(l.TrashBtnNode).dxButton({text:"Recycle Bin",hint:"Recycle Bin",stylingMode:"contained",icon:"trash",disabled:!1,onClick:function(n,t,i){l.OnTrashButtonClick(n,t,i);l.ucShoppingItemsTrashControl.Show()}}).dxButton("instance");l.SelectedItemsCounterNode_CounterValueNode.innerHTML=l.ucGridView.SelectedIDs.length};l.InitFooterBar=function(){l.FooterBarContainer.innerHTML="";l.FooterBarContainer.appendChild(l.FooterBarWrapperNode);l.CancelBtn=$(l.CancelBtnNode).dxButton({text:"CANCEL",hint:"CANCEL",stylingMode:"contained",icon:"close",disabled:!1,onClick:function(){l.OnCancelClick()}}).dxButton("instance");l.ConfirmBtn=$(l.ConfirmBtnNode).dxButton({text:"CONFIRM",hint:"CONFIRM",stylingMode:"contained",icon:"check",disabled:!1,onClick:function(){l.OnConfirmClick()}}).dxButton("instance")};l.OffListeners=function(){l.ucGridView.DataGrid.off("selectionChanged",l.ucGridView_DataGrid_onSelectionChanged)};l.BindListeners=function(){l.OffListeners();l.ucSearchBar.OnClearClick=l.ucSearchBar_OnClearClick;l.ucSearchBar.OnSearchClick=l.ucSearchBar_OnSearchClick;l.ucSearchBar.OnEnterKey=l.ucSearchBar_OnEnterKey;l.ucGridView.DataGrid.on("selectionChanged",l.ucGridView_DataGrid_onSelectionChanged);l.ucGridView.OnEditCommandButtonClick=l.ucGridView_OnEditCommandButtonClick;l.ucGridView.OnDeleteCommandButtonClick=l.ucGridView_OnDeleteCommandButtonClick;l.ucGridView.OnCopyCommandButtonClick=l.ucGridView_OnCopyCommandButtonClick;l.ucShoppingItemsTrashControl.OnShowing=l.ucShoppingItemsTrashControl_OnShowing;l.ucShoppingItemsTrashControl.OnHiding=l.ucShoppingItemsTrashControl_OnHiding};l.GetCurrentEntityStr=function(n){let t="entity";switch(l.EntityType){case"1":case"2":t="video";break;case"3":case"4":t="booth"}return n&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t};l.InitMainSetting=function(n,t){l.EntityID=n;l.EntityType=t;l.ucGridView.InitMainSetting(0,t)};l.InitSelectItemsToSellPopUp();l.Init=function(){return l.SearchText="",new Promise(function(n){l.GetSelectedIdsData().then(function(t){t.message&&k12PopupEFX.Alert(t.message);l.ucGridView.RunSelect=!0;l.ucGridView.SelectedIDs=t.data.IDs;Promise.all([l.ucGridView.Init(),l.ucSearchBar.Init()]).then(function(){l.ucGridView.PageNumber>1&&(l.ucGridView.PageNumber=1);l.InitToolBar();l.InitFooterBar();l.BindListeners();l.OnInitCompleted();n()})})})};t&&l.Init()}}(window);;
+function(n){var t=n.ContractFX=n.ContractFX||{};t.Controls=t.Controls||{};t.Controls.ERFx=t.Controls.ERFx||{};t.Controls.ERFx.ShoppingItemsTrashControl=function(n,t,i,r,u,f,e){let o=this;o.htmlElTag=document.querySelector("html");o.ClientInstanceName=n;o.InitOnPageLoad=t;o.EntityID=u;o.EntityType=f;o.ucGridView=i;o.ucSearchBar=r;o.SiteName=e;o.TrashItemsPopUpContainer=document.querySelector(`[div-trash-items-pop-up="${o.ClientInstanceName}"]`);o.ToolBarContainer=document.querySelector(`[div-tool-bar="${o.ClientInstanceName}"]`);o.FooterBarContainer=document.querySelector(`[div-footer-bar="${o.ClientInstanceName}"]`);o.GetNodeElementsFromString=function(n){var t=document.createElement("div");return t.innerHTML=n,t.firstElementChild};o.Show=function(){o.TrashItemsPopUp.show()};o.Hide=function(){o.TrashItemsPopUp.hide()};o.OnShowing=function(){};o.OnHiding=function(){};o.OnInitCompleted=function(){};o.HandleFetchAsync=async function(n,t){typeof loading!="undefined"&&loading.Show();try{let i=await n;if(!i.ok){let n=await i.json();throw{response:i,errorData:n};}if(t)return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!0,message:""};let r=await i.json();return typeof loading!="undefined"&&loading.Hide(),{data:r,isOk:!0,message:r.ResponseMessage?r.ResponseMessage:null}}catch(i){return i&&i.response&&i.errorData&&i.response.status==400&&i.errorData&&i.errorData.Message?(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:i.errorData.Message?i.errorData.Message:null}):(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Can't receive data from server. Please Contact Us and report a problem."})}return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Please Contact Us and report a problem."}};o.ChangeStatus=async function(n,t){let i=`/api/ShoppingItems/ChangeDeletedStatus`,r={VendorCatalogID:n,Status:t},u=fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});return await o.HandleFetchAsync(u,!0)};o.DeleteItem=async function(n,t){let i=`/api/ShoppingItems/Delete`,r={VendorCatalogID:n,Full:t},u=fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});return await o.HandleFetchAsync(u,!0)};o.ToolBarWrapperTempalte=`
            <div class="grid-toolbar-wrapper">
            </div>
            `;o.FooterBarWrapperTemplate=`
            <div class ="footer-bar-wrapper">
            </div>
            `;o.ToolBarWrapperNode=o.GetNodeElementsFromString(o.ToolBarWrapperTempalte);o.FooterBarWrapperNode=o.GetNodeElementsFromString(o.FooterBarWrapperTemplate);o.ucSearchBar_OnClearClick=function(){o.ucGridView.SearchText="";o.ucGridView.DataGrid.pageIndex(0);o.ucGridView.DataSource.reload()};o.ucSearchBar_OnSearchClick=function(n){o.ucGridView.SearchText=n;o.ucGridView.DataGrid.pageIndex(0);o.ucGridView.DataSource.reload()};o.ucSearchBar_OnEnterKey=function(n){o.ucGridView.SearchText=n;o.ucGridView.DataGrid.pageIndex(0);o.ucGridView.DataSource.reload()};o.ucGridView_OnRestoreCommandButtonClick=function(n){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Restore this item from Recycle Bin?
                        </div>
                        <div class="info-text-block">
                        This item will not be shown in any of your videos until you selected it.
                        </div>
                    </div>`,async function(){let t=await o.ChangeStatus(n,!1);t.message&&k12PopupEFX.Alert(t.message);o.Init()},function(){return})};o.ucGridView_OnHardDeleteCommandButtonClick=function(n){k12PopupEFX.Confirm(`<div class="confirm-text-block">
                        <div>
                        Delete this Item?
                        </div>
                        <div class="info-text-block">
                        This item will be completely removed.
                        </div>
                    </div>`,async function(){let t=await o.DeleteItem(n,!0);t.message&&k12PopupEFX.Alert(t.message);o.Init()},function(){return})};o.InitTrashItemsPopUp=function(){o.TrashItemsPopUp=$(o.TrashItemsPopUpContainer).dxPopup({fullScreen:!1,title:`Recycle Bin`,dragEnabled:!1,width:"95vw",showCloseButton:!0,onShowing:function(){o.OnShowing();o.htmlElTag.classList.add("overfolw-hidden-important");o.Init()},onHiding:function(){o.OnHiding();o.ucGridView.DataGrid.dispose();o.htmlElTag.classList.remove("overfolw-hidden-important")}}).dxPopup("instance")};o.InitToolBar=function(){o.ToolBarContainer.innerHTML="";o.ToolBarContainer.appendChild(o.ToolBarWrapperNode)};o.InitFooterBar=function(){o.FooterBarContainer.innerHTML="";o.FooterBarContainer.appendChild(o.FooterBarWrapperNode)};o.OffListeners=function(){};o.BindListeners=function(){o.OffListeners();o.ucSearchBar.OnClearClick=o.ucSearchBar_OnClearClick;o.ucSearchBar.OnSearchClick=o.ucSearchBar_OnSearchClick;o.ucSearchBar.OnEnterKey=o.ucSearchBar_OnEnterKey;o.ucGridView.OnRestoreCommandButtonClick=o.ucGridView_OnRestoreCommandButtonClick;o.ucGridView.OnHardDeleteCommandButtonClick=o.ucGridView_OnHardDeleteCommandButtonClick};o.InitMainSetting=function(n,t){o.EntityID=n;o.EntityType=t;o.ucGridView.InitMainSetting(n,t)};o.InitTrashItemsPopUp();o.Init=function(){return o.SearchText="",new Promise(function(n){Promise.all([o.ucGridView.Init(),o.ucSearchBar.Init()]).then(function(){o.ucGridView.PageNumber>1&&(o.ucGridView.PageNumber=1);o.InitToolBar();o.InitFooterBar();o.BindListeners();o.OnInitCompleted();n()})})};t&&o.Init()}}(window);;
+function(n){var t=n.ContractFX=n.ContractFX||{};t.Controls=t.Controls||{};t.Controls.ERFx=t.Controls.ERFx||{};t.Controls.ERFx.EpisodeItemsCardView=function(n,t,i,r,u){let f=this;f.ClientInstanceName=n;f.ucShoppingItemsCardView=t;f.ucSearchBar=i;f.OnInitCompleted=function(){};f.HandleFetchAsync=async function(n,t){typeof loading!="undefined"&&u&&loading.Show();try{let i=await n;if(!i.ok){let n=await i.json();throw{response:i,errorData:n};}if(t)return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!0,message:""};let r=await i.json();return typeof loading!="undefined"&&loading.Hide(),{data:r,isOk:!0,message:r.ResponseMessage?r.ResponseMessage:null}}catch(i){return i&&i.response&&i.errorData&&i.response.status==400&&i.errorData&&i.errorData.Message?(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:i.errorData.Message?i.errorData.Message:null}):(typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Can't receive data from server. Please Contact Us and report a problem."})}return typeof loading!="undefined"&&loading.Hide(),{data:null,isOk:!1,message:"Something went wrong. Please Contact Us and report a problem."}};f.ucSearchBar_OnClearClick=function(){f.ucShoppingItemsCardView.SearchText="";f.ucShoppingItemsCardView.DataGrid.pageIndex(0);f.ucShoppingItemsCardView.DataSource.reload()};f.ucSearchBar_OnSearchClick=function(n){f.ucShoppingItemsCardView.SearchText=n;f.ucShoppingItemsCardView.DataGrid.pageIndex(0);f.ucShoppingItemsCardView.DataSource.reload()};f.ucSearchBar_OnEnterKey=function(n){f.ucShoppingItemsCardView.SearchText=n;f.ucShoppingItemsCardView.DataGrid.pageIndex(0);f.ucShoppingItemsCardView.DataSource.reload()};f.BindListeners=function(){f.ucSearchBar.OnClearClick=f.ucSearchBar_OnClearClick;f.ucSearchBar.OnSearchClick=f.ucSearchBar_OnSearchClick;f.ucSearchBar.OnEnterKey=f.ucSearchBar_OnEnterKey};f.GetNodeElementsFromString=function(n){var t=document.createElement("div");return t.innerHTML=n,t.firstElementChild};f.Init=function(){return new Promise(function(n){Promise.all([f.ucShoppingItemsCardView.Init(),f.ucSearchBar.Init()]).then(function(){f.BindListeners();f.OnInitCompleted();n()})})};r&&f.Init()}}(window);;
