@mseva/upyog-ui-module-ads 1.1.10 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),i=require("react-router-dom"),a=require("react-hook-form"),l=require("react-query"),s=require("react-redux"),u=require("redux");function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function d(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"CS_NA"},f=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e};function m(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}const v=function(e){void 0===e&&(e={});const t=e||{},n=(Array.isArray(t.bookingApplication)?t.bookingApplication:[]).map(e=>{const t={};["bookingNo","paymentDate","draftId","applicationDate","tenantId","receiptNo","permissionLetterFilestoreId","paymentReceiptFilestoreId","advertisementId","bookingId","bookingStatus","auditDetails","businessService","workflow"].forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t.applicantDetail=e.applicantDetail||null,t.address=e.address||null,t.owners=e.owners||[],t.documents=e.documents||[];const n=(Array.isArray(e.cartDetails)?e.cartDetails:[]).reduce((e,t)=>{const n=(e=>(e.location||"NA")+"|"+(e.advertisementId||"NA")+"|"+(e.addType||"NA")+"|"+(e.faceArea||"NA")+"|"+(e.advertisementName||"NA")+"|"+(e.poleNo||"NA"))(t);return e[n]||(e[n]=[]),e[n].push(t),e},{}),r=Object.keys(n).map(e=>{var t,r;const o=n[e].slice().sort((e,t)=>new Date(e.bookingDate)-new Date(t.bookingDate));console.log("sorted",o);const i=[];if(o.length){let e=o[0].bookingDate||null,t=o[0].bookingDate||null;for(let n=1;n<o.length;n++){const r=new Date(t),a=new Date(o[n].bookingDate);Math.round((a-r)/864e5)<=7||(i.push([e,t]),e=o[n].bookingDate),t=o[n].bookingDate}i.push([e,t])}const a=(null===(t=o[0])||void 0===t?void 0:t.bookingDate)||null,l=(null===(r=o[o.length-1])||void 0===r?void 0:r.bookingDate)||null,s=o.length,u=o[0]||{},c=o.map(e=>"number"==typeof e.amount?e.amount:null);let d=void 0,p=void 0;if(c.every(e=>null!==e)){const e=c.reduce((e,t)=>e+t,0);p=e,d=o.length?Math.round(e/o.length*100)/100:0}else"number"==typeof u.amount&&(d=u.amount);return{location:u.location,advertisementId:u.advertisementId||0===u.advertisementId?""+u.advertisementId:void 0,startDate:a,endDate:l,numberOfDays:s,dateRanges:i,addType:u.addType,faceArea:u.faceArea,nightLight:u.nightLight,status:u.status,advertisementName:u.advertisementName,poleNo:u.poleNo,amount:d,amountForDaysChosen:p}});return t.cartDetails=r,t});return{bookingData:[{count:n.reduce((e,t)=>e+(Array.isArray(t.cartDetails)?t.cartDetails.reduce((e,t)=>e+(t.numberOfDays||0),0):0),0),currentTime:Date.now(),bookingApplication:n}]}};function h(e){var t;const n={};return null==e||e.forEach(e=>{var t;const r=null==e?void 0:e.advertisementId;n[r]||(n[r]={ad:c({id:Number(r),name:null==e?void 0:e.advertisementName},e),slots:[]}),null===(t=n[r])||void 0===t||t.slots.push({addType:null==e?void 0:e.addType,location:null==e?void 0:e.location,faceArea:null==e?void 0:e.faceArea,nightLight:null==e?void 0:e.nightLight,bookingId:null==e?void 0:e.bookingId,timerValue:0,bookingDate:null==e?void 0:e.bookingDate,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,advertisementId:null==e?void 0:e.advertisementId,slotStaus:null==e?void 0:e.status,bookingFromTime:null==e?void 0:e.bookingFromTime,bookingToTime:null==e?void 0:e.bookingToTime,advertisementName:null==e?void 0:e.advertisementName})}),null===(t=Object.values(n))||void 0===t||t.forEach(e=>{const t=null==e?void 0:e.slots.map(e=>new Date(null==e?void 0:e.bookingDate)),n=new Date(null===Math||void 0===Math?void 0:Math.min(...t)),r=new Date(null===Math||void 0===Math?void 0:Math.max(...t)),o=e=>e.toISOString().split("T")[0];e.ad.bookingStartDate=o(n),e.ad.bookingEndDate=o(r),e.ad.startDate=o(n),e.ad.endDate=o(r)}),Object.values(n)}const g=e=>{var t,n,r,o;const i=null==e||null===(t=e.replace(/([a-z])([A-Z])/g,"$1 $2"))||void 0===t||null===(n=t.replace(/_/g," "))||void 0===n?void 0:n.replace(/([a-z])([0-9])/gi,"$1 $2");return null==i||null===(r=i.split(" "))||void 0===r||null===(o=r.map(e=>{var t;return(null==e||null===(t=e.charAt(0))||void 0===t?void 0:t.toUpperCase())+(null==e?void 0:e.slice(1))}))||void 0===o?void 0:o.join(" ")},y=e=>r.createElement("h1",{className:"heading-m"},e.t("CHB_CANCEL")),E=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(E,null)),b=e=>{let{t:o,closeModal:i,actionCancelLabel:l,actionCancelOnSubmit:s,actionSaveLabel:u,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,f]=n.useState(!1),{handleSubmit:m}=a.useForm();return r.createElement(t.Modal,{headerBarMain:r.createElement(y,{t:o}),headerBarEnd:r.createElement(S,{onClick:i}),actionCancelLabel:o(l),actionCancelOnSubmit:s,actionSaveLabel:o(u),actionSaveOnSubmit:m(c),isDisabled:!p,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},r.createElement("form",{onSubmit:m(d)},r.createElement(t.CheckBox,{label:o("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{f(!p)},style:{height:"auto"}}))))},_=e=>{var o,l,s;let{tenantId:u,isLoading:d,t:p,onSubmit:f,data:m,count:v,setShowToast:h,userType:g}=e;const y=window.Digit.Utils.browser.isMobile(),{register:E,control:S,handleSubmit:_,setValue:A,getValues:D,reset:C,formState:T}=a.useForm({defaultValues:{offset:0,limit:!y&&10,sortBy:"createdTime",sortOrder:"DESC",fromDate:(new Date).toISOString().split("T")[0],toDate:(new Date).toISOString().split("T")[0],status:""}});n.useEffect(()=>{E("offset",0),E("limit",10),E("sortBy","createdTime"),E("sortOrder","DESC"),_(f)()},[E]);const[x,N]=n.useState(""),[w,I]=n.useState(!1),L=Digit.Hooks.ads.useADSCreateAPI(u,!1),k=i.useHistory(),{data:O}=(((null==k||null===(o=k.location)||void 0===o?void 0:o.pathname)||"").split("/").pop(),Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}));O&&O.map(e=>{});const R=e=>r.createElement("span",{className:"cell-text"},e),P=function(){try{I(!1);const e=c({},x,{bookingStatus:"CANCELLED"});return Promise.resolve(L.mutateAsync({bookingApplication:e})).then(function(){_(f)()})}catch(e){return Promise.reject(e)}},M=n.useMemo(()=>[{Header:p("ADS_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(i.Link,{to:"citizen"===g?"/digit-ui/citizen/ads/application/"+t.original.bookingNo+"/"+u:"/digit-ui/employee/ads/applicationsearch/application-details/"+t.original.bookingNo},t.original.bookingNo)))}},{Header:p("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r;return R(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(r=n.applicantDetail)||void 0===r?void 0:r.applicantName))},disableSortBy:!0},{Header:p("ADS_LOCALITY"),Cell:e=>{var t;let{row:n}=e;const r=null==n||null===(t=n.original)||void 0===t?void 0:t.cartDetails,o=null==r?void 0:r.map(e=>null==e?void 0:e.location).join(", ");return R(o)},disableSortBy:!0},{Header:p("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{let{row:t}=e;return R(""+p(null==t?void 0:t.original.bookingStatus))},disableSortBy:!0}],[]),B=[{i18nKey:"Booked",code:"BOOKED",value:p("ADS_BOOKED")},{i18nKey:"Booking in Progress",code:"BOOKING_CREATED",value:p("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:p("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:p("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:p("ADS_CANCELLED")},{i18nKey:"Available",code:"AVAILABLE",value:p("ADS_AVAILABLE")}],F=n.useCallback(e=>{0!==e.length&&(A("sortBy",e.id),A("sortOrder",e.desc?"DESC":"ASC"))},[]);function j(){A("offset",D("offset")-D("limit")),_(f)()}return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(t.Header,null,p("ADS_SEARCH_BOOKINGS")),r.createElement(t.SearchForm,{onSubmit:f,handleSubmit:_},r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_BOOKING_NO")),r.createElement(t.TextInput,{name:"bookingNo",inputRef:E({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_APPLICANT_NAME")),r.createElement(t.TextInput,{name:"applicantName",inputRef:E({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("PT_COMMON_TABLE_COL_STATUS_LABEL")),r.createElement(a.Controller,{control:S,name:"status",render:e=>r.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:B,optionKey:"i18nKey",t:p,disable:!1})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:E({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:r.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),r.createElement(t.CardLabelError,null,null==T||null===(l=T.errors)||void 0===l||null===(s=l.mobileNumber)||void 0===s?void 0:s.message)),r.createElement(t.SearchField,null,r.createElement("label",null,p("EVENTS_FROM_DATE_LABEL")),r.createElement(a.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:S})),r.createElement(t.SearchField,null,r.createElement("label",null,p("EVENTS_TO_DATE_LABEL")),r.createElement(a.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:S})),r.createElement(t.SearchField,{className:"submit"},r.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),r.createElement("p",{style:{marginTop:"10px"},onClick:()=>{C({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),h(null),j()}},p("ES_COMMON_CLEAR_ALL")))),!d&&null!=m&&m.display?r.createElement(t.Card,{style:{marginTop:20}},p(m.display).split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):d||""===m?""!==m||d&&r.createElement(t.Loader,null):r.createElement(t.Table,{t:p,data:m,totalRecords:v,columns:M,getCellProps:e=>({style:{minWidth:e.column.Header===p("ADS_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){A("limit",Number(e.target.value)),_(f)()},currentPage:D("offset")/D("limit"),onNextPage:function(){A("offset",D("offset")+D("limit")),_(f)()},onPrevPage:j,pageSizeLimit:D("limit"),onSort:F,disableSort:!1,sortParams:[{id:D("sortBy"),desc:"DESC"===D("sortOrder")}]})),w&&r.createElement(b,{t:p,closeModal:()=>I(!1),actionCancelLabel:"BACK",actionCancelOnSubmit:()=>I(!1),actionSaveLabel:"ADS_CANCEL",actionSaveOnSubmit:P,onSubmit:P}))},A=e=>{var a,l;let{userType:s}=e;i.useParams();const{t:u}=o.useTranslation(),d="undefined"!=typeof window&&(null===(a=window.location)||void 0===a||null===(l=a.href)||void 0===l?void 0:l.includes("citizen"))?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState({}),[m,v]=n.useState(null);n.useEffect(()=>{if(m){const e=setTimeout(()=>{v(null)},1e3);return()=>clearTimeout(e)}},[m]);const h={enabled:!!(p&&Object.keys(p).length>0)},{isLoading:g,isSuccess:y,data:{bookingApplication:E,Count:S}={}}=Digit.Hooks.ads.useADSSearch({tenantId:d,filters:p},h);return r.createElement(r.Fragment,null,r.createElement(_,{t:u,isLoading:g,tenantId:d,setShowToast:v,onSubmit:function(e){const t=c({},e,e.toDate?{toDate:null==e?void 0:e.toDate}:{},e.fromDate?{fromDate:null==e?void 0:e.fromDate}:{});let n=Object.keys(t).filter(e=>t[e]).reduce((e,n)=>c({},e,{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{});!(Object.entries(n).length>0)||n.bookingNo||n.fromDate||n.status||n.applicantName||n.faceArea||n.toDate||n.mobileNumber?Object.entries(n).length>0&&n.fromDate&&!n.toDate||!n.fromDate&&n.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):f(n):v({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:y&&!g?E.length>0?E:{display:"ES_COMMON_NO_DATA"}:"",count:S,userType:s}),m&&r.createElement(t.Toast,{error:m.error,warning:m.warning,label:u(m.label),onClose:()=>{v(null)}}))},D=["path","url"],C=[],T=()=>{var e,n,a,l,s,u,c,p,f,m;const v=i.useRouteMatch(),{path:h}=v,g=(d(v,D),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewADSStepperForm")),y=null===(a=Digit)||void 0===a||null===(l=a.ComponentRegistryService)||void 0===l?void 0:l.getComponent("ADSMyApplications"),E=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSApplicationDetails"),S=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("ADSResponseCitizen"),b=null===(f=Digit)||void 0===f||null===(m=f.ComponentRegistryService)||void 0===m?void 0:m.getComponent("CitizenApplicationOverview");return r.createElement("span",{className:"ads-citizen",style:{width:"100%"}},r.createElement(i.Switch,null,r.createElement(t.AppContainer,null,(void 0===(_=C)&&(_=[]),_.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":r.createElement(t.BackButton,null,"Back")),r.createElement(t.PrivateRoute,{path:h+"/bookad",component:g}),r.createElement(t.PrivateRoute,{path:h+"/myBookings",component:y}),r.createElement(t.PrivateRoute,{path:h+"/application/:acknowledgementIds/:tenantId",component:E}),r.createElement(t.PrivateRoute,{path:h+"/adsservice/:response/:bookingNo",component:S}),r.createElement(t.PrivateRoute,{path:h+"/adsservice/:application-overview/:bookingNo",component:b}))));var _},x=e=>{var n;let{status:i,searchParams:a,onAssignmentChange:l,statusMap:s}=e;return o.useTranslation(),r.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>l(c({},e,{state:i.state}),i),checked:null==a||null===(u=a.applicationStatus)||void 0===u?void 0:u.some(e=>e.uuid===i.uuid),label:i.name+" ("+((null==s||null===(n=s.find(e=>e.statusid===i.uuid))||void 0===n?void 0:n.count)||"-")+")"});var u},N=e=>{var i,a,l,s,u;let{onAssignmentChange:d,searchParams:p,businessServices:f,statusMap:m}=e;const{t:v}=o.useTranslation(),[h,g]=n.useState(!1),{data:y,isLoading:E}=Digit.Hooks.useApplicationStatusGeneral({businessServices:f},{}),{userRoleStates:S}=y||{},b={"ADV.CREATE":v("ES_ADV_NEW_BOOKING"),"ADV.UPDATE":v("ES_ADV_UPDATE_BOOKING")},_=(e,t)=>t(b[e.stateBusinessService])+" - "+t("ES_ADS_COMMON_STATUS_"+(e.state||"CREATED"));return E?r.createElement(t.Loader,null):null!=S&&S.filter(e=>!e.isTerminateState).length?r.createElement("div",{className:"status-container"},r.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_INBOX_STATUS")),null==S||null===(i=S.filter(e=>!e.isTerminateState))||void 0===i||null===(a=i.slice(0,4))||void 0===a?void 0:a.map((e,t)=>r.createElement(x,{businessServices:f,key:t,onAssignmentChange:d,status:c({name:_(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m})),(null==S||null===(l=S.filter(e=>!e.isTerminateState))||void 0===l?void 0:l.slice(4).length)>0?r.createElement(r.Fragment,null,h&&(null==S||null===(s=S.filter(e=>!e.isTerminateState))||void 0===s||null===(u=s.slice(4))||void 0===u?void 0:u.map((e,t)=>r.createElement(x,{businessServices:f,key:e.uuid,onAssignmentChange:d,status:c({name:_(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m}))),r.createElement("div",{className:"filter-button",onClick:()=>g(!h)}," ",v(h?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null};var w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function I(e,t){return e(t={exports:{}},t.exports),t.exports}var L=I(function(e,t){(function(){var n="Expected a function",r="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",a="[object Array]",l="[object Boolean]",s="[object Date]",u="[object Error]",c="[object Function]",d="[object GeneratorFunction]",p="[object Map]",f="[object Number]",m="[object Object]",v="[object RegExp]",h="[object Set]",g="[object String]",y="[object Symbol]",E="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",_="[object Float32Array]",A="[object Float64Array]",D="[object Int8Array]",C="[object Int16Array]",T="[object Int32Array]",x="[object Uint8Array]",N="[object Uint16Array]",I="[object Uint32Array]",L=/\b__p \+= '';/g,k=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(R.source),B=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/[\\^$.*+?()[\]{}|]/g,V=RegExp(q.source),G=/^\s+/,K=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,re=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",fe="["+ce+"]",me="\\d+",ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",_e="(?:"+ve+"|"+he+")",Ae="(?:"+be+"|"+he+")",De="(?:"+fe+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[ye,Ee,Se].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",Ee,Se].join("|")+")"+Ce,xe="(?:"+[ye+fe+"?",fe,Ee,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),we=RegExp(fe,"g"),Ie=RegExp(ge+"(?="+ge+")|"+xe+Ce,"g"),Le=RegExp([be+"?"+ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,be,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,be+_e,"$"].join("|")+")",be+"?"+_e+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Te].join("|"),"g"),ke=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Oe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Pe=-1,Me={};Me[_]=Me[A]=Me[D]=Me[C]=Me[T]=Me[x]=Me["[object Uint8ClampedArray]"]=Me[N]=Me[I]=!0,Me[i]=Me[a]=Me[S]=Me[l]=Me[b]=Me[s]=Me[u]=Me[c]=Me[p]=Me[f]=Me[m]=Me[v]=Me[h]=Me[g]=Me[E]=!1;var Be={};Be[i]=Be[a]=Be[S]=Be[b]=Be[l]=Be[s]=Be[_]=Be[A]=Be[D]=Be[C]=Be[T]=Be[p]=Be[f]=Be[m]=Be[v]=Be[h]=Be[g]=Be[y]=Be[x]=Be["[object Uint8ClampedArray]"]=Be[N]=Be[I]=!0,Be[u]=Be[c]=Be[E]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},je=parseFloat,He=parseInt,Ue="object"==typeof w&&w&&w.Object===Object&&w,ze="object"==typeof self&&self&&self.Object===Object&&self,We=Ue||ze||Function("return this")(),qe=t&&!t.nodeType&&t,Ve=qe&&e&&!e.nodeType&&e,Ge=Ve&&Ve.exports===qe,Ke=Ge&&Ue.process,Ye=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),$e=Ye&&Ye.isArrayBuffer,Xe=Ye&&Ye.isDate,Ze=Ye&&Ye.isMap,Je=Ye&&Ye.isRegExp,Qe=Ye&&Ye.isSet,et=Ye&&Ye.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function lt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function st(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function ut(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ct(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function dt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function pt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function ft(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=bt("length");function vt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function ht(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):ht(e,Et,n)}function yt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Et(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function _t(e){return function(t){return null==e?void 0:e[t]}}function At(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function Dt(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Ct(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Tt(e){return e?e.slice(0,qt(e)+1).replace(G,""):e}function xt(e){return function(t){return e(t)}}function Nt(e,t){return ut(t,function(t){return e[t]})}function wt(e,t){return e.has(t)}function It(e,t){for(var n=-1,r=e.length;++n<r&>(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function kt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Ot=_t({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=_t({"&":"&","<":"<",">":">",'"':""","'":"'"});function Pt(e){return"\\"+Fe[e]}function Mt(e){return ke.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function jt(e,t){for(var n=-1,o=e.length,i=0,a=[];++n<o;){var l=e[n];l!==t&&l!==r||(e[n]=r,a[i++]=n)}return a}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function zt(e){return Mt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):mt(e)}function Wt(e){return Mt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function qt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Vt=_t({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var w,K=(t=null==t?We:Gt.defaults(We.Object(),t,Gt.pick(We,Re))).Array,ce=t.Date,de=t.Error,pe=t.Function,fe=t.Math,me=t.Object,ve=t.RegExp,he=t.String,ge=t.TypeError,ye=K.prototype,Ee=me.prototype,Se=t["__core-js_shared__"],be=pe.prototype.toString,_e=Ee.hasOwnProperty,Ae=0,De=(w=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Ce=Ee.toString,Te=be.call(me),xe=We._,Ie=ve("^"+be.call(_e).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ke=Ge?t.Buffer:void 0,Fe=t.Symbol,Ue=t.Uint8Array,ze=ke?ke.allocUnsafe:void 0,qe=Ft(me.getPrototypeOf,me),Ve=me.create,Ke=Ee.propertyIsEnumerable,Ye=ye.splice,mt=Fe?Fe.isConcatSpreadable:void 0,_t=Fe?Fe.iterator:void 0,Kt=Fe?Fe.toStringTag:void 0,Yt=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==We.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==We.Date.now&&ce.now,Zt=t.setTimeout!==We.setTimeout&&t.setTimeout,Jt=fe.ceil,Qt=fe.floor,en=me.getOwnPropertySymbols,tn=ke?ke.isBuffer:void 0,nn=t.isFinite,rn=ye.join,on=Ft(me.keys,me),an=fe.max,ln=fe.min,sn=ce.now,un=t.parseInt,cn=fe.random,dn=ye.reverse,pn=Qo(t,"DataView"),fn=Qo(t,"Map"),mn=Qo(t,"Promise"),vn=Qo(t,"Set"),hn=Qo(t,"WeakMap"),gn=Qo(me,"create"),yn=hn&&new hn,En={},Sn=Ni(pn),bn=Ni(fn),_n=Ni(mn),An=Ni(vn),Dn=Ni(hn),Cn=Fe?Fe.prototype:void 0,Tn=Cn?Cn.valueOf:void 0,xn=Cn?Cn.toString:void 0;function Nn(e){if(Va(e)&&!Ra(e)&&!(e instanceof kn)){if(e instanceof Ln)return e;if(_e.call(e,"__wrapped__"))return wi(e)}return new Ln(e)}var wn=function(){function e(){}return function(t){if(!qa(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function Ln(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function kn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Rn(e);this.size=t.size}function Fn(e,t){var n=Ra(e),r=!n&&Oa(e),o=!n&&!r&&Fa(e),i=!n&&!r&&!o&&Qa(e),a=n||r||o||i,l=a?Ct(e.length,he):[],s=l.length;for(var u in e)!t&&!_e.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ai(u,s))||l.push(u);return l}function jn(e){var t=e.length;return t?e[Pr(0,t-1)]:void 0}function Hn(e,t){return Ai(go(e),$n(t,0,e.length))}function Un(e){return Ai(go(e))}function zn(e,t,n){(void 0!==n&&!Ia(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function Wn(e,t,n){var r=e[t];_e.call(e,t)&&Ia(r,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function qn(e,t){for(var n=e.length;n--;)if(Ia(e[n][0],t))return n;return-1}function Vn(e,t,n,r){return er(e,function(e,o,i){t(r,e,n(e),i)}),r}function Gn(e,t){return e&&yo(t,bl(t),e)}function Kn(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,r=t.length,o=K(r),i=null==e;++n<r;)o[n]=i?void 0:hl(e,t[n]);return o}function $n(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,r,o,a){var u,E=1&t,w=2&t,L=4&t;if(n&&(u=o?n(e,r,o,a):n(e)),void 0!==u)return u;if(!qa(e))return e;var k=Ra(e);if(k){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!E)return go(e,u)}else{var O=ni(e),R=O==c||O==d;if(Fa(e))return co(e,E);if(O==m||O==i||R&&!o){if(u=w||R?{}:oi(e),!E)return w?function(e,t){return yo(e,ti(e),t)}(e,function(e,t){return e&&yo(t,_l(t),e)}(u,e)):function(e,t){return yo(e,ei(e),t)}(e,Gn(u,e))}else{if(!Be[O])return o?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case S:return po(e);case l:case s:return new r(+e);case b:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case _:case A:case D:case C:case T:case x:case"[object Uint8ClampedArray]":case N:case I:return fo(e,n);case p:return new r;case f:case g:return new r(e);case v:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return new r;case y:return Tn?me(Tn.call(e)):{}}}(e,O,E)}}a||(a=new Bn);var P=a.get(e);if(P)return P;a.set(e,u),Xa(e)?e.forEach(function(r){u.add(Xn(r,t,n,r,e,a))}):Ga(e)&&e.forEach(function(r,o){u.set(o,Xn(r,t,n,o,e,a))});var M=k?void 0:(L?w?Go:Vo:w?_l:bl)(e);return rt(M||e,function(r,o){M&&(r=e[o=r]),Wn(u,o,Xn(r,t,n,o,e,a))}),u}function Zn(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var o=n[r],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,r){if("function"!=typeof e)throw new ge(n);return Ei(function(){e.apply(void 0,r)},t)}function Qn(e,t,n,r){var o=-1,i=lt,a=!0,l=e.length,s=[],u=t.length;if(!l)return s;n&&(t=ut(t,xt(n))),r?(i=st,a=!1):t.length>=200&&(i=wt,a=!1,t=new Mn(t));e:for(;++o<l;){var c=e[o],d=null==n?c:n(c);if(c=r||0!==c?c:0,a&&d==d){for(var p=u;p--;)if(t[p]===d)continue e;s.push(c)}else i(t,d,r)||s.push(c)}return s}Nn.templateSettings={escape:F,evaluate:j,interpolate:H,variable:"",imports:{_:Nn}},(Nn.prototype=In.prototype).constructor=Nn,(Ln.prototype=wn(In.prototype)).constructor=Ln,(kn.prototype=wn(In.prototype)).constructor=kn,On.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return _e.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:_e.call(t,e)},On.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gn&&void 0===t?"__lodash_hash_undefined__":t,this},Rn.prototype.clear=function(){this.__data__=[],this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=qn(t,e);return!(n<0||(n==t.length-1?t.pop():Ye.call(t,n,1),--this.size,0))},Rn.prototype.get=function(e){var t=this.__data__,n=qn(t,e);return n<0?void 0:t[n][1]},Rn.prototype.has=function(e){return qn(this.__data__,e)>-1},Rn.prototype.set=function(e,t){var n=this.__data__,r=qn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(fn||Rn),string:new On}},Pn.prototype.delete=function(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Zo(this,e).get(e)},Pn.prototype.has=function(e){return Zo(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Zo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new Rn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Rn){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=bo(sr),tr=bo(ur,!0);function nr(e,t){var n=!0;return er(e,function(e,r,o){return n=!!t(e,r,o)}),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],a=t(i);if(null!=a&&(void 0===l?a==a&&!Ja(a):n(a,l)))var l=a,s=i}return s}function or(e,t){var n=[];return er(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function ir(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ii),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?ir(l,t-1,n,r,o):ct(o,l):r||(o[o.length]=l)}return o}var ar=_o(),lr=_o(!0);function sr(e,t){return e&&ar(e,t,bl)}function ur(e,t){return e&&lr(e,t,bl)}function cr(e,t){return at(t,function(t){return Ua(e[t])})}function dr(e,t){for(var n=0,r=(t=ao(t,e)).length;null!=e&&n<r;)e=e[xi(t[n++])];return n&&n==r?e:void 0}function pr(e,t,n){var r=t(e);return Ra(e)?r:ct(r,n(e))}function fr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=_e.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var r=!0}catch(e){}var o=Ce.call(e);return r&&(t?e[Kt]=n:delete e[Kt]),o}(e):function(e){return Ce.call(e)}(e)}function mr(e,t){return e>t}function vr(e,t){return null!=e&&_e.call(e,t)}function hr(e,t){return null!=e&&t in me(e)}function gr(e,t,n){for(var r=n?st:lt,o=e[0].length,i=e.length,a=i,l=K(i),s=Infinity,u=[];a--;){var c=e[a];a&&t&&(c=ut(c,xt(t))),s=ln(c.length,s),l[a]=!n&&(t||o>=120&&c.length>=120)?new Mn(a&&c):void 0}c=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<s;){var f=c[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?wt(p,m):r(u,m,n))){for(a=i;--a;){var v=l[a];if(!(v?wt(v,m):r(e[a],m,n)))continue e}p&&p.push(m),u.push(f)}}return u}function yr(e,t,n){var r=null==(e=vi(e,t=ao(t,e)))?e:e[xi(Hi(t))];return null==r?void 0:tt(r,e,n)}function Er(e){return Va(e)&&fr(e)==i}function Sr(e,t,n,r,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,r,o,c){var d=Ra(e),E=Ra(t),_=d?a:ni(e),A=E?a:ni(t),D=(_=_==i?m:_)==m,C=(A=A==i?m:A)==m,T=_==A;if(T&&Fa(e)){if(!Fa(t))return!1;d=!0,D=!1}if(T&&!D)return c||(c=new Bn),d||Qa(e)?Wo(e,t,n,r,o,c):function(e,t,n,r,o,i,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new Ue(e),new Ue(t)));case l:case s:case f:return Ia(+e,+t);case u:return e.name==t.name&&e.message==t.message;case v:case g:return e==t+"";case p:var c=Bt;case h:if(c||(c=Ht),e.size!=t.size&&!(1&r))return!1;var d=a.get(e);if(d)return d==t;r|=2,a.set(e,t);var m=Wo(c(e),c(t),r,o,i,a);return a.delete(e),m;case y:if(Tn)return Tn.call(e)==Tn.call(t)}return!1}(e,t,_,n,r,o,c);if(!(1&n)){var x=D&&_e.call(e,"__wrapped__"),N=C&&_e.call(t,"__wrapped__");if(x||N){var w=x?e.value():e,I=N?t.value():t;return c||(c=new Bn),o(w,I,n,r,c)}}return!!T&&(c||(c=new Bn),function(e,t,n,r,o,i){var a=1&n,l=Vo(e),s=l.length;if(s!=Vo(t).length&&!a)return!1;for(var u=s;u--;){var c=l[u];if(!(a?c in t:_e.call(t,c)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var m=a;++u<s;){var v=e[c=l[u]],h=t[c];if(r)var g=a?r(h,v,c,t,e,i):r(v,h,c,e,t,i);if(!(void 0===g?v===h||o(v,h,n,r,i):g)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var y=e.constructor,E=t.constructor;y==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof E&&E instanceof E||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,r,o,c))}(e,t,n,r,Sr,o))}function br(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=me(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<i;){var s=(l=n[o])[0],u=e[s],c=l[1];if(a&&l[2]){if(void 0===u&&!(s in e))return!1}else{var d=new Bn;if(r)var p=r(u,c,s,e,t,d);if(!(void 0===p?Sr(c,u,3,r,d):p))return!1}}return!0}function _r(e){return!(!qa(e)||(t=e,De&&De in t))&&(Ua(e)?Ie:oe).test(Ni(e));var t}function Ar(e){return"function"==typeof e?e:null==e?Kl:"object"==typeof e?Ra(e)?Nr(e[0],e[1]):xr(e):ns(e)}function Dr(e){if(!di(e))return on(e);var t=[];for(var n in me(e))_e.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cr(e,t){return e<t}function Tr(e,t){var n=-1,r=Ma(e)?K(e.length):[];return er(e,function(e,o,i){r[++n]=t(e,o,i)}),r}function xr(e){var t=Jo(e);return 1==t.length&&t[0][2]?fi(t[0][0],t[0][1]):function(n){return n===e||br(n,e,t)}}function Nr(e,t){return si(e)&&pi(t)?fi(xi(e),t):function(n){var r=hl(n,e);return void 0===r&&r===t?gl(n,e):Sr(t,r,3)}}function wr(e,t,n,r,o){e!==t&&ar(t,function(i,a){if(o||(o=new Bn),qa(i))!function(e,t,n,r,o,i,a){var l=gi(e,n),s=gi(t,n),u=a.get(s);if(u)zn(e,n,u);else{var c=i?i(l,s,n+"",e,t,a):void 0,d=void 0===c;if(d){var p=Ra(s),f=!p&&Fa(s),m=!p&&!f&&Qa(s);c=s,p||f||m?Ra(l)?c=l:Ba(l)?c=go(l):f?(d=!1,c=co(s,!0)):m?(d=!1,c=fo(s,!0)):c=[]:Ya(s)||Oa(s)?(c=l,Oa(l)?c=ll(l):qa(l)&&!Ua(l)||(c=oi(s))):d=!1}d&&(a.set(s,c),o(c,s,r,i,a),a.delete(s)),zn(e,n,c)}}(e,t,a,n,wr,r,o);else{var l=r?r(gi(e,a),i,a+"",e,t,o):void 0;void 0===l&&(l=i),zn(e,a,l)}},_l)}function Ir(e,t){var n=e.length;if(n)return ai(t+=t<0?n:0,n)?e[t]:void 0}function Lr(e,t,n){t=t.length?ut(t,function(e){return Ra(e)?function(t){return dr(t,1===e.length?e[0]:e)}:e}):[Kl];var r=-1;return t=ut(t,xt(Xo())),function(e,t){var r=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,a=o.length,l=n.length;++r<a;){var s=mo(o[r],i[r]);if(s)return r>=l?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Tr(e,function(e,n,o){return{criteria:ut(t,function(t){return t(e)}),index:++r,value:e}}))}function kr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=dr(e,a);n(l,a)&&Hr(i,ao(a,e),l)}return i}function Or(e,t,n,r){var o=r?yt:gt,i=-1,a=t.length,l=e;for(e===t&&(t=go(t)),n&&(l=ut(e,xt(n)));++i<a;)for(var s=0,u=t[i],c=n?n(u):u;(s=o(l,c,s,r))>-1;)l!==e&&Ye.call(l,s,1),Ye.call(e,s,1);return e}function Rr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;ai(o)?Ye.call(e,o,1):Jr(e,o)}}return e}function Pr(e,t){return e+Qt(cn()*(t-e+1))}function Mr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return Si(mi(e,t,Kl),e+"")}function Fr(e){return jn(Il(e))}function jr(e,t){var n=Il(e);return Ai(n,$n(t,0,n.length))}function Hr(e,t,n,r){if(!qa(e))return e;for(var o=-1,i=(t=ao(t,e)).length,a=i-1,l=e;null!=l&&++o<i;){var s=xi(t[o]),u=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(o!=a){var c=l[s];void 0===(u=r?r(c,s,l):void 0)&&(u=qa(c)?c:ai(t[o+1])?[]:{})}Wn(l,s,u),l=l[s]}return e}var Ur=yn?function(e,t){return yn.set(e,t),e}:Kl,zr=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:ql(t),writable:!0})}:Kl;function Wr(e){return Ai(Il(e))}function qr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=K(o);++r<o;)i[r]=e[r+t];return i}function Vr(e,t){var n;return er(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!Ja(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return Kr(e,t,Kl,n)}function Kr(e,t,n,r){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,l=null===t,s=Ja(t),u=void 0===t;o<i;){var c=Qt((o+i)/2),d=n(e[c]),p=void 0!==d,f=null===d,m=d==d,v=Ja(d);if(a)var h=r||m;else h=u?m&&(r||p):l?m&&p&&(r||!f):s?m&&p&&!f&&(r||!v):!f&&!v&&(r?d<=t:d<t);h?o=c+1:i=c}return ln(i,4294967294)}function Yr(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],l=t?t(a):a;if(!n||!Ia(l,s)){var s=l;i[o++]=0===a?0:a}}return i}function $r(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xr(e){if("string"==typeof e)return e;if(Ra(e))return ut(e,Xr)+"";if(Ja(e))return xn?xn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zr(e,t,n){var r=-1,o=lt,i=e.length,a=!0,l=[],s=l;if(n)a=!1,o=st;else if(i>=200){var u=t?null:Bo(e);if(u)return Ht(u);a=!1,o=wt,s=new Mn}else s=t?[]:l;e:for(;++r<i;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=s.length;p--;)if(s[p]===d)continue e;t&&s.push(d),l.push(c)}else o(s,d,n)||(s!==l&&s.push(d),l.push(c))}return l}function Jr(e,t){return null==(e=vi(e,t=ao(t,e)))||delete e[xi(Hi(t))]}function Qr(e,t,n,r){return Hr(e,t,n(dr(e,t)),r)}function eo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?qr(e,r?0:i,r?i+1:o):qr(e,r?i+1:0,r?o:i)}function to(e,t){var n=e;return n instanceof kn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function no(e,t,n){var r=e.length;if(r<2)return r?Zr(e[0]):[];for(var o=-1,i=K(r);++o<r;)for(var a=e[o],l=-1;++l<r;)l!=o&&(i[o]=Qn(i[o]||a,e[l],t,n));return Zr(ir(i,1),t,n)}function ro(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;)n(a,e[r],r<i?t[r]:void 0);return a}function oo(e){return Ba(e)?e:[]}function io(e){return"function"==typeof e?e:Kl}function ao(e,t){return Ra(e)?e:si(e,t)?[e]:Ti(sl(e))}var lo=Br;function so(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:qr(e,t,n)}var uo=$t||function(e){return We.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function fo(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Ja(e),a=void 0!==t,l=null===t,s=t==t,u=Ja(t);if(!l&&!u&&!i&&e>t||i&&a&&s&&!l&&!u||r&&a&&s||!n&&s||!o)return 1;if(!r&&!i&&!u&&e<t||u&&n&&o&&!r&&!i||l&&n&&o||!a&&o||!s)return-1}return 0}function vo(e,t,n,r){for(var o=-1,i=e.length,a=n.length,l=-1,s=t.length,u=an(i-a,0),c=K(s+u),d=!r;++l<s;)c[l]=t[l];for(;++o<a;)(d||o<i)&&(c[n[o]]=e[o]);for(;u--;)c[l++]=e[o++];return c}function ho(e,t,n,r){for(var o=-1,i=e.length,a=-1,l=n.length,s=-1,u=t.length,c=an(i-l,0),d=K(c+u),p=!r;++o<c;)d[o]=e[o];for(var f=o;++s<u;)d[f+s]=t[s];for(;++a<l;)(p||o<i)&&(d[f+n[a]]=e[o++]);return d}function go(e,t){var n=-1,r=e.length;for(t||(t=K(r));++n<r;)t[n]=e[n];return t}function yo(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var l=t[i],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),o?Kn(n,l,s):Wn(n,l,s)}return n}function Eo(e,t){return function(n,r){var o=Ra(n)?nt:Vn,i=t?t():{};return o(n,e,Xo(r,2),i)}}function So(e){return Br(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&li(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=me(t);++r<o;){var l=n[r];l&&e(t,l,r,i)}return t})}function bo(e,t){return function(n,r){if(null==n)return n;if(!Ma(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=me(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function _o(e){return function(t,n,r){for(var o=-1,i=me(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}function Ao(e){return function(t){var n=Mt(t=sl(t))?Wt(t):void 0,r=n?n[0]:t.charAt(0),o=n?so(n,1).join(""):t.slice(1);return r[e]()+o}}function Do(e){return function(t){return dt(Ul(Ol(t).replace(Ne,"")),e,"")}}function Co(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=wn(e.prototype),r=e.apply(n,t);return qa(r)?r:n}}function To(e){return function(t,n,r){var o=me(t);if(!Ma(t)){var i=Xo(n,3);t=bl(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[i?t[a]:a]:void 0}}function xo(e){return qo(function(t){var r=t.length,o=r,i=Ln.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new ge(n);if(i&&!l&&"wrapper"==Yo(a))var l=new Ln([],!0)}for(o=l?o:r;++o<r;){var s=Yo(a=t[o]),u="wrapper"==s?Ko(a):void 0;l=u&&ui(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[Yo(u[0])].apply(l,u[3]):1==a.length&&ui(a)?l[s]():l.thru(a)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ra(n))return l.plant(n).value();for(var o=0,i=r?t[o].apply(this,e):n;++o<r;)i=t[o].call(this,i);return i}})}function No(e,t,n,r,o,i,a,l,s,u){var c=128&t,d=1&t,p=2&t,f=24&t,m=512&t,v=p?void 0:Co(e);return function h(){for(var g=arguments.length,y=K(g),E=g;E--;)y[E]=arguments[E];if(f)var S=$o(h),b=kt(y,S);if(r&&(y=vo(y,r,o,f)),i&&(y=ho(y,i,a,f)),g-=b,f&&g<u){var _=jt(y,S);return Po(e,t,No,h.placeholder,n,y,_,l,s,u-g)}var A=d?n:this,D=p?A[e]:e;return g=y.length,l?y=hi(y,l):m&&g>1&&y.reverse(),c&&s<g&&(y.length=s),this&&this!==We&&this instanceof h&&(D=v||Co(D)),D.apply(A,y)}}function wo(e,t){return function(n,r){return function(e,t,n,r){return sr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Io(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Xr(n),r=Xr(r)):(n=$r(n),r=$r(r)),o=e(n,r)}return o}}function Lo(e){return qo(function(t){return t=ut(t,xt(Xo())),Br(function(n){var r=this;return e(t,function(e){return tt(e,r,n)})})})}function ko(e,t){var n=(t=void 0===t?" ":Xr(t)).length;if(n<2)return n?Mr(t,e):t;var r=Mr(t,Jt(e/zt(t)));return Mt(t)?so(Wt(r),0,e).join(""):r.slice(0,e)}function Oo(e){return function(t,n,r){return r&&"number"!=typeof r&&li(t,n,r)&&(n=r=void 0),t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n,r){for(var o=-1,i=an(Jt((t-e)/(n||1)),0),a=K(i);i--;)a[r?i:++o]=e,e+=n;return a}(t,n,r=void 0===r?t<n?1:-1:rl(r),e)}}function Ro(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=al(t),n=al(n)),e(t,n)}}function Po(e,t,n,r,o,i,a,l,s,u){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,l,s,u],p=n.apply(void 0,d);return ui(e)&&yi(p,d),p.placeholder=r,bi(p,e,t)}function Mo(e){var t=fe[e];return function(e,n){if(e=al(e),(n=null==n?0:ln(ol(n),292))&&nn(e)){var r=(sl(e)+"e").split("e");return+((r=(sl(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Bo=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Jl;function Fo(e){return function(t){var n=ni(t);return n==p?Bt(t):n==h?Ut(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function jo(e,t,o,i,a,l,s,u){var c=2&t;if(!c&&"function"!=typeof e)throw new ge(n);var d=i?i.length:0;if(d||(t&=-97,i=a=void 0),s=void 0===s?s:an(ol(s),0),u=void 0===u?u:ol(u),d-=a?a.length:0,64&t){var p=i,f=a;i=a=void 0}var m=c?void 0:Ko(e),v=[e,t,o,i,a,p,f,l,s,u];if(m&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var a=t[3];if(a){var l=e[3];e[3]=l?vo(l,a,t[4]):a,e[4]=l?jt(e[3],r):t[4]}(a=t[5])&&(e[5]=(l=e[5])?ho(l,a,t[6]):a,e[6]=l?jt(e[5],r):t[6]),(a=t[7])&&(e[7]=a),128&o&&(e[8]=null==e[8]?t[8]:ln(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(v,m),e=v[0],t=v[1],o=v[2],i=v[3],a=v[4],!(u=v[9]=void 0===v[9]?c?0:e.length:an(v[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var r=Co(e);return function o(){for(var i=arguments.length,a=K(i),l=i,s=$o(o);l--;)a[l]=arguments[l];var u=i<3&&a[0]!==s&&a[i-1]!==s?[]:jt(a,s);if((i-=u.length)<n)return Po(e,t,No,o.placeholder,void 0,a,u,void 0,void 0,n-i);var c=this&&this!==We&&this instanceof o?r:e;return tt(c,this,a)}}(e,t,u):32!=t&&33!=t||a.length?No.apply(void 0,v):function(e,t,n,r){var o=1&t,i=Co(e);return function t(){for(var a=-1,l=arguments.length,s=-1,u=r.length,c=K(u+l),d=this&&this!==We&&this instanceof t?i:e;++s<u;)c[s]=r[s];for(;l--;)c[s++]=arguments[++a];return tt(d,o?n:this,c)}}(e,t,o,i);else var h=function(e,t,n){var r=1&t,o=Co(e);return function t(){var i=this&&this!==We&&this instanceof t?o:e;return i.apply(r?n:this,arguments)}}(e,t,o);return bi((m?Ur:yi)(h,v),e,t)}function Ho(e,t,n,r){return void 0===e||Ia(e,Ee[n])&&!_e.call(r,n)?t:e}function Uo(e,t,n,r,o,i){return qa(e)&&qa(t)&&(i.set(t,e),wr(e,t,void 0,Uo,i),i.delete(t)),e}function zo(e){return Ya(e)?void 0:e}function Wo(e,t,n,r,o,i){var a=1&n,l=e.length,s=t.length;if(l!=s&&!(a&&s>l))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,f=2&n?new Mn:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var m=e[d],v=t[d];if(r)var h=a?r(v,m,d,t,e,i):r(m,v,d,e,t,i);if(void 0!==h){if(h)continue;p=!1;break}if(f){if(!ft(t,function(e,t){if(!wt(f,t)&&(m===e||o(m,e,n,r,i)))return f.push(t)})){p=!1;break}}else if(m!==v&&!o(m,v,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function qo(e){return Si(mi(e,void 0,Pi),e+"")}function Vo(e){return pr(e,bl,ei)}function Go(e){return pr(e,_l,ti)}var Ko=yn?function(e){return yn.get(e)}:Jl;function Yo(e){for(var t=e.name+"",n=En[t],r=_e.call(En,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function $o(e){return(_e.call(Nn,"placeholder")?Nn:e).placeholder}function Xo(){var e=Nn.iteratee||Yl;return e=e===Yl?Ar:e,arguments.length?e(arguments[0],arguments[1]):e}function Zo(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=bl(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,pi(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _r(n)?n:void 0}var ei=en?function(e){return null==e?[]:(e=me(e),at(en(e),function(t){return Ke.call(e,t)}))}:is,ti=en?function(e){for(var t=[];e;)ct(t,ei(e)),e=qe(e);return t}:is,ni=fr;function ri(e,t,n){for(var r=-1,o=(t=ao(t,e)).length,i=!1;++r<o;){var a=xi(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Wa(o)&&ai(a,o)&&(Ra(e)||Oa(e))}function oi(e){return"function"!=typeof e.constructor||di(e)?{}:wn(qe(e))}function ii(e){return Ra(e)||Oa(e)||!!(mt&&e&&e[mt])}function ai(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function li(e,t,n){if(!qa(n))return!1;var r=typeof t;return!!("number"==r?Ma(n)&&ai(t,n.length):"string"==r&&t in n)&&Ia(n[t],e)}function si(e,t){if(Ra(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||z.test(e)||!U.test(e)||null!=t&&e in me(t)}function ui(e){var t=Yo(e),n=Nn[t];if("function"!=typeof n||!(t in kn.prototype))return!1;if(e===n)return!0;var r=Ko(n);return!!r&&e===r[0]}(pn&&ni(new pn(new ArrayBuffer(1)))!=b||fn&&ni(new fn)!=p||mn&&"[object Promise]"!=ni(mn.resolve())||vn&&ni(new vn)!=h||hn&&ni(new hn)!=E)&&(ni=function(e){var t=fr(e),n=t==m?e.constructor:void 0,r=n?Ni(n):"";if(r)switch(r){case Sn:return b;case bn:return p;case _n:return"[object Promise]";case An:return h;case Dn:return E}return t});var ci=Se?Ua:as;function di(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function pi(e){return e==e&&!qa(e)}function fi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mi(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=an(r.length-t,0),a=K(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=K(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),tt(e,this,l)}}function vi(e,t){return t.length<2?e:dr(e,qr(t,0,-1))}function hi(e,t){for(var n=e.length,r=ln(t.length,n),o=go(e);r--;){var i=t[r];e[r]=ai(i,n)?o[i]:void 0}return e}function gi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var yi=_i(Ur),Ei=Zt||function(e,t){return We.setTimeout(e,t)},Si=_i(zr);function bi(e,t,n){var r=t+"";return Si(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Y,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return rt(o,function(n){var r="_."+n[0];t&n[1]&&!lt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(X):[]}(r),n)))}function _i(e){var t=0,n=0;return function(){var r=sn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ai(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var i=Pr(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Di,Ci,Ti=(Di=Da(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(W,function(e,n,r,o){t.push(r?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ci.size&&Ci.clear(),e}),Ci=Di.cache,Di);function xi(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ni(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wi(e){if(e instanceof kn)return e.clone();var t=new Ln(e.__wrapped__,e.__chain__);return t.__actions__=go(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ii=Br(function(e,t){return Ba(e)?Qn(e,ir(t,1,Ba,!0)):[]}),Li=Br(function(e,t){var n=Hi(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ir(t,1,Ba,!0),Xo(n,2)):[]}),ki=Br(function(e,t){var n=Hi(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ir(t,1,Ba,!0),void 0,n):[]});function Oi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),ht(e,Xo(t,3),o)}function Ri(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ol(n),o=n<0?an(r+o,0):ln(o,r-1)),ht(e,Xo(t,3),o,!0)}function Pi(e){return null!=e&&e.length?ir(e,1):[]}function Mi(e){return e&&e.length?e[0]:void 0}var Bi=Br(function(e){var t=ut(e,oo);return t.length&&t[0]===e[0]?gr(t):[]}),Fi=Br(function(e){var t=Hi(e),n=ut(e,oo);return t===Hi(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gr(n,Xo(t,2)):[]}),ji=Br(function(e){var t=Hi(e),n=ut(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gr(n,void 0,t):[]});function Hi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ui=Br(zi);function zi(e,t){return e&&e.length&&t&&t.length?Or(e,t):e}var Wi=qo(function(e,t){var n=null==e?0:e.length,r=Yn(e,t);return Rr(e,ut(t,function(e){return ai(e,n)?+e:e}).sort(mo)),r});function qi(e){return null==e?e:dn.call(e)}var Vi=Br(function(e){return Zr(ir(e,1,Ba,!0))}),Gi=Br(function(e){var t=Hi(e);return Ba(t)&&(t=void 0),Zr(ir(e,1,Ba,!0),Xo(t,2))}),Ki=Br(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,Zr(ir(e,1,Ba,!0),void 0,t)});function Yi(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=an(e.length,t),!0}),Ct(t,function(t){return ut(e,bt(t))})}function $i(e,t){if(!e||!e.length)return[];var n=Yi(e);return null==t?n:ut(n,function(e){return tt(t,void 0,e)})}var Xi=Br(function(e,t){return Ba(e)?Qn(e,t):[]}),Zi=Br(function(e){return no(at(e,Ba))}),Ji=Br(function(e){var t=Hi(e);return Ba(t)&&(t=void 0),no(at(e,Ba),Xo(t,2))}),Qi=Br(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,no(at(e,Ba),void 0,t)}),ea=Br(Yi),ta=Br(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$i(e,n)});function na(e){var t=Nn(e);return t.__chain__=!0,t}function ra(e,t){return t(e)}var oa=qo(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof kn&&ai(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ra,args:[o],thisArg:void 0}),new Ln(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),ia=Eo(function(e,t,n){_e.call(e,n)?++e[n]:Kn(e,n,1)}),aa=To(Oi),la=To(Ri);function sa(e,t){return(Ra(e)?rt:er)(e,Xo(t,3))}function ua(e,t){return(Ra(e)?ot:tr)(e,Xo(t,3))}var ca=Eo(function(e,t,n){_e.call(e,n)?e[n].push(t):Kn(e,n,[t])}),da=Br(function(e,t,n){var r=-1,o="function"==typeof t,i=Ma(e)?K(e.length):[];return er(e,function(e){i[++r]=o?tt(t,e,n):yr(e,t,n)}),i}),pa=Eo(function(e,t,n){Kn(e,n,t)});function fa(e,t){return(Ra(e)?ut:Tr)(e,Xo(t,3))}var ma=Eo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),va=Br(function(e,t){if(null==e)return[];var n=t.length;return n>1&&li(e,t[0],t[1])?t=[]:n>2&&li(t[0],t[1],t[2])&&(t=[t[0]]),Lr(e,ir(t,1),[])}),ha=Xt||function(){return We.Date.now()};function ga(e,t,n){return t=n?void 0:t,jo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ya(e,t){var r;if("function"!=typeof t)throw new ge(n);return e=ol(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var Ea=Br(function(e,t,n){var r=1;if(n.length){var o=jt(n,$o(Ea));r|=32}return jo(e,r,t,n,o)}),Sa=Br(function(e,t,n){var r=3;if(n.length){var o=jt(n,$o(Sa));r|=32}return jo(t,r,e,n,o)});function ba(e,t,r){var o,i,a,l,s,u,c=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new ge(n);function m(t){var n=o,r=i;return o=i=void 0,c=t,l=e.apply(r,n)}function v(e){return c=e,s=Ei(g,t),d?m(e):l}function h(e){var n=e-u;return void 0===u||n>=t||n<0||p&&e-c>=a}function g(){var e=ha();if(h(e))return y(e);s=Ei(g,function(e){var n=t-(e-u);return p?ln(n,a-(e-c)):n}(e))}function y(e){return s=void 0,f&&o?m(e):(o=i=void 0,l)}function E(){var e=ha(),n=h(e);if(o=arguments,i=this,u=e,n){if(void 0===s)return v(u);if(p)return uo(s),s=Ei(g,t),m(u)}return void 0===s&&(s=Ei(g,t)),l}return t=al(t)||0,qa(r)&&(d=!!r.leading,a=(p="maxWait"in r)?an(al(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),E.cancel=function(){void 0!==s&&uo(s),c=0,o=u=i=s=void 0},E.flush=function(){return void 0===s?l:y(ha())},E}var _a=Br(function(e,t){return Jn(e,1,t)}),Aa=Br(function(e,t,n){return Jn(e,al(t)||0,n)});function Da(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ge(n);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Da.Cache||Pn),r}function Ca(e){if("function"!=typeof e)throw new ge(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Da.Cache=Pn;var Ta=lo(function(e,t){var n=(t=1==t.length&&Ra(t[0])?ut(t[0],xt(Xo())):ut(ir(t,1),xt(Xo()))).length;return Br(function(r){for(var o=-1,i=ln(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return tt(e,this,r)})}),xa=Br(function(e,t){return jo(e,32,void 0,t,jt(t,$o(xa)))}),Na=Br(function(e,t){return jo(e,64,void 0,t,jt(t,$o(Na)))}),wa=qo(function(e,t){return jo(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var La=Ro(mr),ka=Ro(function(e,t){return e>=t}),Oa=Er(function(){return arguments}())?Er:function(e){return Va(e)&&_e.call(e,"callee")&&!Ke.call(e,"callee")},Ra=K.isArray,Pa=$e?xt($e):function(e){return Va(e)&&fr(e)==S};function Ma(e){return null!=e&&Wa(e.length)&&!Ua(e)}function Ba(e){return Va(e)&&Ma(e)}var Fa=tn||as,ja=Xe?xt(Xe):function(e){return Va(e)&&fr(e)==s};function Ha(e){if(!Va(e))return!1;var t=fr(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(e)}function Ua(e){if(!qa(e))return!1;var t=fr(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function za(e){return"number"==typeof e&&e==ol(e)}function Wa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Ze?xt(Ze):function(e){return Va(e)&&ni(e)==p};function Ka(e){return"number"==typeof e||Va(e)&&fr(e)==f}function Ya(e){if(!Va(e)||fr(e)!=m)return!1;var t=qe(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Te}var $a=Je?xt(Je):function(e){return Va(e)&&fr(e)==v},Xa=Qe?xt(Qe):function(e){return Va(e)&&ni(e)==h};function Za(e){return"string"==typeof e||!Ra(e)&&Va(e)&&fr(e)==g}function Ja(e){return"symbol"==typeof e||Va(e)&&fr(e)==y}var Qa=et?xt(et):function(e){return Va(e)&&Wa(e.length)&&!!Me[fr(e)]},el=Ro(Cr),tl=Ro(function(e,t){return e<=t});function nl(e){if(!e)return[];if(Ma(e))return Za(e)?Wt(e):go(e);if(_t&&e[_t])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[_t]());var t=ni(e);return(t==p?Bt:t==h?Ht:Il)(e)}function rl(e){return e?(e=al(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ol(e){var t=rl(e),n=t%1;return t==t?n?t-n:t:0}function il(e){return e?$n(ol(e),0,4294967295):0}function al(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=re.test(e);return n||ie.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ll(e){return yo(e,_l(e))}function sl(e){return null==e?"":Xr(e)}var ul=So(function(e,t){if(di(t)||Ma(t))yo(t,bl(t),e);else for(var n in t)_e.call(t,n)&&Wn(e,n,t[n])}),cl=So(function(e,t){yo(t,_l(t),e)}),dl=So(function(e,t,n,r){yo(t,_l(t),e,r)}),pl=So(function(e,t,n,r){yo(t,bl(t),e,r)}),fl=qo(Yn),ml=Br(function(e,t){e=me(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&li(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],a=_l(i),l=-1,s=a.length;++l<s;){var u=a[l],c=e[u];(void 0===c||Ia(c,Ee[u])&&!_e.call(e,u))&&(e[u]=i[u])}return e}),vl=Br(function(e){return e.push(void 0,Uo),tt(Dl,void 0,e)});function hl(e,t,n){var r=null==e?void 0:dr(e,t);return void 0===r?n:r}function gl(e,t){return null!=e&&ri(e,t,hr)}var yl=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},ql(Kl)),El=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),_e.call(e,t)?e[t].push(n):e[t]=[n]},Xo),Sl=Br(yr);function bl(e){return Ma(e)?Fn(e):Dr(e)}function _l(e){return Ma(e)?Fn(e,!0):function(e){if(!qa(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=di(e),n=[];for(var r in e)("constructor"!=r||!t&&_e.call(e,r))&&n.push(r);return n}(e)}var Al=So(function(e,t,n){wr(e,t,n)}),Dl=So(function(e,t,n,r){wr(e,t,n,r)}),Cl=qo(function(e,t){var n={};if(null==e)return n;var r=!1;t=ut(t,function(t){return t=ao(t,e),r||(r=t.length>1),t}),yo(e,Go(e),n),r&&(n=Xn(n,7,zo));for(var o=t.length;o--;)Jr(n,t[o]);return n}),Tl=qo(function(e,t){return null==e?{}:function(e,t){return kr(e,t,function(t,n){return gl(e,n)})}(e,t)});function xl(e,t){if(null==e)return{};var n=ut(Go(e),function(e){return[e]});return t=Xo(t),kr(e,n,function(e,n){return t(e,n[0])})}var Nl=Fo(bl),wl=Fo(_l);function Il(e){return null==e?[]:Nt(e,bl(e))}var Ll=Do(function(e,t,n){return t=t.toLowerCase(),e+(n?kl(t):t)});function kl(e){return Hl(sl(e).toLowerCase())}function Ol(e){return(e=sl(e))&&e.replace(le,Ot).replace(we,"")}var Rl=Do(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Pl=Do(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ml=Ao("toLowerCase"),Bl=Do(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fl=Do(function(e,t,n){return e+(n?" ":"")+Hl(t)}),jl=Do(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Hl=Ao("toUpperCase");function Ul(e,t,n){return e=sl(e),void 0===(t=n?void 0:t)?function(e){return Oe.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var zl=Br(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ha(e)?e:new de(e)}}),Wl=qo(function(e,t){return rt(t,function(t){t=xi(t),Kn(e,t,Ea(e[t],e))}),e});function ql(e){return function(){return e}}var Vl=xo(),Gl=xo(!0);function Kl(e){return e}function Yl(e){return Ar("function"==typeof e?e:Xn(e,1))}var $l=Br(function(e,t){return function(n){return yr(n,e,t)}}),Xl=Br(function(e,t){return function(n){return yr(e,n,t)}});function Zl(e,t,n){var r=bl(t),o=cr(t,r);null!=n||qa(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=cr(t,bl(t)));var i=!(qa(n)&&"chain"in n&&!n.chain),a=Ua(e);return rt(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=go(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ct([this.value()],arguments))})}),e}function Jl(){}var Ql=Lo(ut),es=Lo(it),ts=Lo(ft);function ns(e){return si(e)?bt(xi(e)):function(e){return function(t){return dr(t,e)}}(e)}var rs=Oo(),os=Oo(!0);function is(){return[]}function as(){return!1}var ls,ss=Io(function(e,t){return e+t},0),us=Mo("ceil"),cs=Io(function(e,t){return e/t},1),ds=Mo("floor"),ps=Io(function(e,t){return e*t},1),fs=Mo("round"),ms=Io(function(e,t){return e-t},0);return Nn.after=function(e,t){if("function"!=typeof t)throw new ge(n);return e=ol(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=ga,Nn.assign=ul,Nn.assignIn=cl,Nn.assignInWith=dl,Nn.assignWith=pl,Nn.at=fl,Nn.before=ya,Nn.bind=Ea,Nn.bindAll=Wl,Nn.bindKey=Sa,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Nn.chain=na,Nn.chunk=function(e,t,n){t=(n?li(e,t,n):void 0===t)?1:an(ol(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var o=0,i=0,a=K(Jt(r/t));o<r;)a[i++]=qr(e,o,o+=t);return a},Nn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return ct(Ra(n)?go(n):[n],ir(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,r=Xo();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new ge(n);return[r(e[0]),e[1]]}):[],Br(function(n){for(var r=-1;++r<t;){var o=e[r];if(tt(o[0],this,n))return tt(o[1],this,n)}})},Nn.conforms=function(e){return function(e){var t=bl(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},Nn.constant=ql,Nn.countBy=ia,Nn.create=function(e,t){var n=wn(e);return null==t?n:Gn(n,t)},Nn.curry=function e(t,n,r){var o=jo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Nn.curryRight=function e(t,n,r){var o=jo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Nn.debounce=ba,Nn.defaults=ml,Nn.defaultsDeep=vl,Nn.defer=_a,Nn.delay=Aa,Nn.difference=Ii,Nn.differenceBy=Li,Nn.differenceWith=ki,Nn.drop=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,(t=n||void 0===t?1:ol(t))<0?0:t,r):[]},Nn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,0,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0):[]},Nn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&li(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ol(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ol(r))<0&&(r+=o),r=n>r?0:il(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Nn.filter=function(e,t){return(Ra(e)?at:or)(e,Xo(t,3))},Nn.flatMap=function(e,t){return ir(fa(e,t),1)},Nn.flatMapDeep=function(e,t){return ir(fa(e,t),1/0)},Nn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ol(n),ir(fa(e,t),n)},Nn.flatten=Pi,Nn.flattenDeep=function(e){return null!=e&&e.length?ir(e,1/0):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?ir(e,t=void 0===t?1:ol(t)):[]},Nn.flip=function(e){return jo(e,512)},Nn.flow=Vl,Nn.flowRight=Gl,Nn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Nn.functions=function(e){return null==e?[]:cr(e,bl(e))},Nn.functionsIn=function(e){return null==e?[]:cr(e,_l(e))},Nn.groupBy=ca,Nn.initial=function(e){return null!=e&&e.length?qr(e,0,-1):[]},Nn.intersection=Bi,Nn.intersectionBy=Fi,Nn.intersectionWith=ji,Nn.invert=yl,Nn.invertBy=El,Nn.invokeMap=da,Nn.iteratee=Yl,Nn.keyBy=pa,Nn.keys=bl,Nn.keysIn=_l,Nn.map=fa,Nn.mapKeys=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,t(e,r,o),e)}),n},Nn.mapValues=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,r,t(e,r,o))}),n},Nn.matches=function(e){return xr(Xn(e,1))},Nn.matchesProperty=function(e,t){return Nr(e,Xn(t,1))},Nn.memoize=Da,Nn.merge=Al,Nn.mergeWith=Dl,Nn.method=$l,Nn.methodOf=Xl,Nn.mixin=Zl,Nn.negate=Ca,Nn.nthArg=function(e){return e=ol(e),Br(function(t){return Ir(t,e)})},Nn.omit=Cl,Nn.omitBy=function(e,t){return xl(e,Ca(Xo(t)))},Nn.once=function(e){return ya(2,e)},Nn.orderBy=function(e,t,n,r){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(n=r?void 0:n)||(n=null==n?[]:[n]),Lr(e,t,n))},Nn.over=Ql,Nn.overArgs=Ta,Nn.overEvery=es,Nn.overSome=ts,Nn.partial=xa,Nn.partialRight=Na,Nn.partition=ma,Nn.pick=Tl,Nn.pickBy=xl,Nn.property=ns,Nn.propertyOf=function(e){return function(t){return null==e?void 0:dr(e,t)}},Nn.pull=Ui,Nn.pullAll=zi,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,Xo(n,2)):e},Nn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,void 0,n):e},Nn.pullAt=Wi,Nn.range=rs,Nn.rangeRight=os,Nn.rearg=wa,Nn.reject=function(e,t){return(Ra(e)?at:or)(e,Ca(Xo(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=Xo(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Rr(e,o),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new ge(n);return Br(e,t=void 0===t?t:ol(t))},Nn.reverse=qi,Nn.sampleSize=function(e,t,n){return t=(n?li(e,t,n):void 0===t)?1:ol(t),(Ra(e)?Hn:jr)(e,t)},Nn.set=function(e,t,n){return null==e?e:Hr(e,t,n)},Nn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Hr(e,t,n,r)},Nn.shuffle=function(e){return(Ra(e)?Un:Wr)(e)},Nn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&li(e,t,n)?(t=0,n=r):(t=null==t?0:ol(t),n=void 0===n?r:ol(n)),qr(e,t,n)):[]},Nn.sortBy=va,Nn.sortedUniq=function(e){return e&&e.length?Yr(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?Yr(e,Xo(t,2)):[]},Nn.split=function(e,t,n){return n&&"number"!=typeof n&&li(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=sl(e))&&("string"==typeof t||null!=t&&!$a(t))&&!(t=Xr(t))&&Mt(e)?so(Wt(e),0,n):e.split(t,n):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new ge(n);return t=null==t?0:an(ol(t),0),Br(function(n){var r=n[t],o=so(n,0,t);return r&&ct(o,r),tt(e,this,o)})},Nn.tail=function(e){var t=null==e?0:e.length;return t?qr(e,1,t):[]},Nn.take=function(e,t,n){return e&&e.length?qr(e,0,(t=n||void 0===t?1:ol(t))<0?0:t):[]},Nn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t,r):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,r){var o=!0,i=!0;if("function"!=typeof e)throw new ge(n);return qa(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),ba(e,t,{leading:o,maxWait:t,trailing:i})},Nn.thru=ra,Nn.toArray=nl,Nn.toPairs=Nl,Nn.toPairsIn=wl,Nn.toPath=function(e){return Ra(e)?ut(e,xi):Ja(e)?[e]:go(Ti(sl(e)))},Nn.toPlainObject=ll,Nn.transform=function(e,t,n){var r=Ra(e),o=r||Fa(e)||Qa(e);if(t=Xo(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:qa(e)&&Ua(i)?wn(qe(e)):{}}return(o?rt:sr)(e,function(e,r,o){return t(n,e,r,o)}),n},Nn.unary=function(e){return ga(e,1)},Nn.union=Vi,Nn.unionBy=Gi,Nn.unionWith=Ki,Nn.uniq=function(e){return e&&e.length?Zr(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?Zr(e,Xo(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zr(e,void 0,t):[]},Nn.unset=function(e,t){return null==e||Jr(e,t)},Nn.unzip=Yi,Nn.unzipWith=$i,Nn.update=function(e,t,n){return null==e?e:Qr(e,t,io(n))},Nn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Qr(e,t,io(n),r)},Nn.values=Il,Nn.valuesIn=function(e){return null==e?[]:Nt(e,_l(e))},Nn.without=Xi,Nn.words=Ul,Nn.wrap=function(e,t){return xa(io(t),e)},Nn.xor=Zi,Nn.xorBy=Ji,Nn.xorWith=Qi,Nn.zip=ea,Nn.zipObject=function(e,t){return ro(e||[],t||[],Wn)},Nn.zipObjectDeep=function(e,t){return ro(e||[],t||[],Hr)},Nn.zipWith=ta,Nn.entries=Nl,Nn.entriesIn=wl,Nn.extend=cl,Nn.extendWith=dl,Zl(Nn,Nn),Nn.add=ss,Nn.attempt=zl,Nn.camelCase=Ll,Nn.capitalize=kl,Nn.ceil=us,Nn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=al(n))==n?n:0),void 0!==t&&(t=(t=al(t))==t?t:0),$n(al(e),t,n)},Nn.clone=function(e){return Xn(e,4)},Nn.cloneDeep=function(e){return Xn(e,5)},Nn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Nn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Nn.conformsTo=function(e,t){return null==t||Zn(e,t,bl(t))},Nn.deburr=Ol,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=cs,Nn.endsWith=function(e,t,n){e=sl(e),t=Xr(t);var r=e.length,o=n=void 0===n?r:$n(ol(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Nn.eq=Ia,Nn.escape=function(e){return(e=sl(e))&&B.test(e)?e.replace(P,Rt):e},Nn.escapeRegExp=function(e){return(e=sl(e))&&V.test(e)?e.replace(q,"\\$&"):e},Nn.every=function(e,t,n){var r=Ra(e)?it:nr;return n&&li(e,t,n)&&(t=void 0),r(e,Xo(t,3))},Nn.find=aa,Nn.findIndex=Oi,Nn.findKey=function(e,t){return vt(e,Xo(t,3),sr)},Nn.findLast=la,Nn.findLastIndex=Ri,Nn.findLastKey=function(e,t){return vt(e,Xo(t,3),ur)},Nn.floor=ds,Nn.forEach=sa,Nn.forEachRight=ua,Nn.forIn=function(e,t){return null==e?e:ar(e,Xo(t,3),_l)},Nn.forInRight=function(e,t){return null==e?e:lr(e,Xo(t,3),_l)},Nn.forOwn=function(e,t){return e&&sr(e,Xo(t,3))},Nn.forOwnRight=function(e,t){return e&&ur(e,Xo(t,3))},Nn.get=hl,Nn.gt=La,Nn.gte=ka,Nn.has=function(e,t){return null!=e&&ri(e,t,vr)},Nn.hasIn=gl,Nn.head=Mi,Nn.identity=Kl,Nn.includes=function(e,t,n,r){e=Ma(e)?e:Il(e),n=n&&!r?ol(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Za(e)?n<=o&&e.indexOf(t,n)>-1:!!o&>(e,t,n)>-1},Nn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),gt(e,t,o)},Nn.inRange=function(e,t,n){return t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n){return e>=ln(t,n)&&e<an(t,n)}(e=al(e),t,n)},Nn.invoke=Sl,Nn.isArguments=Oa,Nn.isArray=Ra,Nn.isArrayBuffer=Pa,Nn.isArrayLike=Ma,Nn.isArrayLikeObject=Ba,Nn.isBoolean=function(e){return!0===e||!1===e||Va(e)&&fr(e)==l},Nn.isBuffer=Fa,Nn.isDate=ja,Nn.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ya(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(Ma(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Qa(e)||Oa(e)))return!e.length;var t=ni(e);if(t==p||t==h)return!e.size;if(di(e))return!Dr(e).length;for(var n in e)if(_e.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return Sr(e,t)},Nn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?Sr(e,t,void 0,n):!!r},Nn.isError=Ha,Nn.isFinite=function(e){return"number"==typeof e&&nn(e)},Nn.isFunction=Ua,Nn.isInteger=za,Nn.isLength=Wa,Nn.isMap=Ga,Nn.isMatch=function(e,t){return e===t||br(e,t,Jo(t))},Nn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,br(e,t,Jo(t),n)},Nn.isNaN=function(e){return Ka(e)&&e!=+e},Nn.isNative=function(e){if(ci(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _r(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=Ka,Nn.isObject=qa,Nn.isObjectLike=Va,Nn.isPlainObject=Ya,Nn.isRegExp=$a,Nn.isSafeInteger=function(e){return za(e)&&e>=-9007199254740991&&e<=9007199254740991},Nn.isSet=Xa,Nn.isString=Za,Nn.isSymbol=Ja,Nn.isTypedArray=Qa,Nn.isUndefined=function(e){return void 0===e},Nn.isWeakMap=function(e){return Va(e)&&ni(e)==E},Nn.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==fr(e)},Nn.join=function(e,t){return null==e?"":rn.call(e,t)},Nn.kebabCase=Rl,Nn.last=Hi,Nn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ol(n))<0?an(r+o,0):ln(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):ht(e,Et,o,!0)},Nn.lowerCase=Pl,Nn.lowerFirst=Ml,Nn.lt=el,Nn.lte=tl,Nn.max=function(e){return e&&e.length?rr(e,Kl,mr):void 0},Nn.maxBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),mr):void 0},Nn.mean=function(e){return St(e,Kl)},Nn.meanBy=function(e,t){return St(e,Xo(t,2))},Nn.min=function(e){return e&&e.length?rr(e,Kl,Cr):void 0},Nn.minBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),Cr):void 0},Nn.stubArray=is,Nn.stubFalse=as,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=ps,Nn.nth=function(e,t){return e&&e.length?Ir(e,ol(t)):void 0},Nn.noConflict=function(){return We._===this&&(We._=xe),this},Nn.noop=Jl,Nn.now=ha,Nn.pad=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return ko(Qt(o),n)+e+ko(Jt(o),n)},Nn.padEnd=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?e+ko(t-r,n):e},Nn.padStart=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?ko(t-r,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(sl(e).replace(G,""),t||0)},Nn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&li(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=rl(e),void 0===t?(t=e,e=0):t=rl(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=cn();return ln(e+o*(t-e+je("1e-"+((o+"").length-1))),t)}return Pr(e,t)},Nn.reduce=function(e,t,n){var r=Ra(e)?dt:At,o=arguments.length<3;return r(e,Xo(t,4),n,o,er)},Nn.reduceRight=function(e,t,n){var r=Ra(e)?pt:At,o=arguments.length<3;return r(e,Xo(t,4),n,o,tr)},Nn.repeat=function(e,t,n){return t=(n?li(e,t,n):void 0===t)?1:ol(t),Mr(sl(e),t)},Nn.replace=function(){var e=arguments,t=sl(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,n){var r=-1,o=(t=ao(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var i=null==e?void 0:e[xi(t[r])];void 0===i&&(r=o,i=n),e=Ua(i)?i.call(e):i}return e},Nn.round=fs,Nn.runInContext=e,Nn.sample=function(e){return(Ra(e)?jn:Fr)(e)},Nn.size=function(e){if(null==e)return 0;if(Ma(e))return Za(e)?zt(e):e.length;var t=ni(e);return t==p||t==h?e.size:Dr(e).length},Nn.snakeCase=Bl,Nn.some=function(e,t,n){var r=Ra(e)?ft:Vr;return n&&li(e,t,n)&&(t=void 0),r(e,Xo(t,3))},Nn.sortedIndex=function(e,t){return Gr(e,t)},Nn.sortedIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Ia(e[r],t))return r}return-1},Nn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gr(e,t,!0)-1;if(Ia(e[n],t))return n}return-1},Nn.startCase=Fl,Nn.startsWith=function(e,t,n){return e=sl(e),n=null==n?0:$n(ol(n),0,e.length),t=Xr(t),e.slice(n,n+t.length)==t},Nn.subtract=ms,Nn.sum=function(e){return e&&e.length?Dt(e,Kl):0},Nn.sumBy=function(e,t){return e&&e.length?Dt(e,Xo(t,2)):0},Nn.template=function(e,t,n){var r=Nn.templateSettings;n&&li(e,t,n)&&(t=void 0),e=sl(e),t=dl({},t,r,Ho);var o,i,a=dl({},t.imports,r.imports,Ho),l=bl(a),s=Nt(a,l),u=0,c=t.interpolate||se,d="__p += '",p=ve((t.escape||se).source+"|"+c.source+"|"+(c===H?ee:se).source+"|"+(t.evaluate||se).source+"|$","g"),f="//# sourceURL="+(_e.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pe+"]")+"\n";e.replace(p,function(t,n,r,a,l,s){return r||(r=a),d+=e.slice(u,s).replace(ue,Pt),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),l&&(i=!0,d+="';\n"+l+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+t.length,t}),d+="';\n";var m=_e.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(L,""):d).replace(k,"$1").replace(O,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=zl(function(){return pe(l,f+"return "+d).apply(void 0,s)});if(v.source=d,Ha(v))throw v;return v},Nn.times=function(e,t){if((e=ol(e))<1||e>9007199254740991)return[];var n=4294967295,r=ln(e,4294967295);e-=4294967295;for(var o=Ct(r,t=Xo(t));++n<e;)t(n);return o},Nn.toFinite=rl,Nn.toInteger=ol,Nn.toLength=il,Nn.toLower=function(e){return sl(e).toLowerCase()},Nn.toNumber=al,Nn.toSafeInteger=function(e){return e?$n(ol(e),-9007199254740991,9007199254740991):0===e?e:0},Nn.toString=sl,Nn.toUpper=function(e){return sl(e).toUpperCase()},Nn.trim=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=Xr(t)))return e;var r=Wt(e),o=Wt(t);return so(r,It(r,o),Lt(r,o)+1).join("")},Nn.trimEnd=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.slice(0,qt(e)+1);if(!e||!(t=Xr(t)))return e;var r=Wt(e);return so(r,0,Lt(r,Wt(t))+1).join("")},Nn.trimStart=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Xr(t)))return e;var r=Wt(e);return so(r,It(r,Wt(t))).join("")},Nn.truncate=function(e,t){var n=30,r="...";if(qa(t)){var o="separator"in t?t.separator:o;n="length"in t?ol(t.length):n,r="omission"in t?Xr(t.omission):r}var i=(e=sl(e)).length;if(Mt(e)){var a=Wt(e);i=a.length}if(n>=i)return e;var l=n-zt(r);if(l<1)return r;var s=a?so(a,0,l).join(""):e.slice(0,l);if(void 0===o)return s+r;if(a&&(l+=s.length-l),$a(o)){if(e.slice(l).search(o)){var u,c=s;for(o.global||(o=ve(o.source,sl(te.exec(o))+"g")),o.lastIndex=0;u=o.exec(c);)var d=u.index;s=s.slice(0,void 0===d?l:d)}}else if(e.indexOf(Xr(o),l)!=l){var p=s.lastIndexOf(o);p>-1&&(s=s.slice(0,p))}return s+r},Nn.unescape=function(e){return(e=sl(e))&&M.test(e)?e.replace(R,Vt):e},Nn.uniqueId=function(e){var t=++Ae;return sl(e)+t},Nn.upperCase=jl,Nn.upperFirst=Hl,Nn.each=sa,Nn.eachRight=ua,Nn.first=Mi,Zl(Nn,(ls={},sr(Nn,function(e,t){_e.call(Nn.prototype,t)||(ls[t]=e)}),ls),{chain:!1}),Nn.VERSION="4.17.21",rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nn[e].placeholder=Nn}),rt(["drop","take"],function(e,t){kn.prototype[e]=function(n){n=void 0===n?1:an(ol(n),0);var r=this.__filtered__&&!t?new kn(this):this.clone();return r.__filtered__?r.__takeCount__=ln(n,r.__takeCount__):r.__views__.push({size:ln(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},kn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;kn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),rt(["head","last"],function(e,t){var n="take"+(t?"Right":"");kn.prototype[e]=function(){return this[n](1).value()[0]}}),rt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");kn.prototype[e]=function(){return this.__filtered__?new kn(this):this[n](1)}}),kn.prototype.compact=function(){return this.filter(Kl)},kn.prototype.find=function(e){return this.filter(e).head()},kn.prototype.findLast=function(e){return this.reverse().find(e)},kn.prototype.invokeMap=Br(function(e,t){return"function"==typeof e?new kn(this):this.map(function(n){return yr(n,e,t)})}),kn.prototype.reject=function(e){return this.filter(Ca(Xo(e)))},kn.prototype.slice=function(e,t){e=ol(e);var n=this;return n.__filtered__&&(e>0||t<0)?new kn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ol(t))<0?n.dropRight(-t):n.take(t-e)),n)},kn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},kn.prototype.toArray=function(){return this.take(4294967295)},sr(kn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Nn[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(Nn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof kn,s=a[0],u=l||Ra(t),c=function(e){var t=o.apply(Nn,ct([e],a));return r&&d?t[0]:t};u&&n&&"function"==typeof s&&1!=s.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=i&&!d,m=l&&!p;if(!i&&u){t=m?t:new kn(this);var v=e.apply(t,a);return v.__actions__.push({func:ra,args:[c],thisArg:void 0}),new Ln(v,d)}return f&&m?e.apply(this,a):(v=this.thru(c),f?r?v.value()[0]:v.value():v)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ra(o)?o:[],e)}return this[n](function(n){return t.apply(Ra(n)?n:[],e)})}}),sr(kn.prototype,function(e,t){var n=Nn[t];if(n){var r=n.name+"";_e.call(En,r)||(En[r]=[]),En[r].push({name:t,func:n})}}),En[No(void 0,2).name]=[{name:"wrapper",func:void 0}],kn.prototype.clone=function(){var e=new kn(this.__wrapped__);return e.__actions__=go(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=go(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=go(this.__views__),e},kn.prototype.reverse=function(){if(this.__filtered__){var e=new kn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},kn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ra(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ln(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,l=i.end,s=l-a,u=r?l:a-1,c=this.__iteratees__,d=c.length,p=0,f=ln(s,this.__takeCount__);if(!n||!r&&o==s&&f==s)return to(e,this.__actions__);var m=[];e:for(;s--&&p<f;){for(var v=-1,h=e[u+=t];++v<d;){var g=c[v],y=g.type,E=(0,g.iteratee)(h);if(2==y)h=E;else if(!E){if(1==y)continue e;break e}}m[p++]=h}return m},Nn.prototype.at=oa,Nn.prototype.chain=function(){return na(this)},Nn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Nn.prototype.next=function(){void 0===this.__values__&&(this.__values__=nl(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,n=this;n instanceof In;){var r=wi(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof kn){var t=e;return this.__actions__.length&&(t=new kn(this)),(t=t.reverse()).__actions__.push({func:ra,args:[qi],thisArg:void 0}),new Ln(t,this.__chain__)}return this.thru(qi)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,_t&&(Nn.prototype[_t]=function(){return this}),Nn}();Ve?((Ve.exports=Gt)._=Gt,qe._=Gt):We._=Gt}).call(w)});const k=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],O=e=>{var i;let{searchParams:a,onFilterChange:s,defaultSearchParams:u,statusMap:p,moduleCode:f}=e,m=d(e,k);const{t:v}=o.useTranslation(),h=l.useQueryClient(),[g,y]=(Digit.ULBService.getCurrentTenantId(),Digit.UserService.getUser(),n.useState(()=>({services:(null==a?void 0:a.services)||["ADV"]}))),E=n.useMemo(()=>[{code:"ASSIGNED_TO_ME",name:v("ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:v("ASSIGNED_TO_ALL")}],[v]),S=E[1],[b,_]=n.useState(S),[A,D]=n.useState((null==a||null===(i=a.filters)||void 0===i?void 0:i.wfFilters)||{assignee:[{code:""}]}),C=(v("ADS_NEW_BOOKING_APPLICATION"),e=>{let t=e.delete,n=c({},g,e);t&&t.forEach(e=>delete n[e]),delete e.delete,y(c({},n))}),T=()=>{y(c({},u,{services:[]})),s(c({},u))};return r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading",style:{alignItems:"center"}},r.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},r.createElement("span",null,r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),r.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},v("ES_COMMON_FILTER_BY"),":")),r.createElement("div",{className:"clearAll",onClick:T},v("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&r.createElement("span",{className:"clear-search",onClick:T,style:{border:"1px solid #e0e0e0",padding:"6px"}},r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&r.createElement("span",{onClick:m.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:e=>{_(e),D({uuid:e}),s(c({},g,{uuid:e}))},selectedOption:b,t:v,optionsKey:"name",options:E}),r.createElement("div",null,r.createElement(N,{searchParams:g,businessServices:["ADV"],statusMap:p||h.getQueryData("INBOX_STATUS_MAP_"+f),moduleCode:f,onAssignmentChange:(e,t)=>{C(e.target.checked?{applicationStatus:[...g.applicationStatus||[],t]}:{applicationStatus:null==g?void 0:g.applicationStatus.filter(e=>e.state!==t.state)})}})),r.createElement("div",null,r.createElement(t.SubmitBar,{onSubmit:()=>{s(c({},g,{wfFilters:A}))},label:v("ES_COMMON_APPLY")}))))))},R=e=>r.createElement("span",{className:"cell-text"},e),P=e=>r.createElement("span",{className:"sla-cell"},e),M=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];I(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:w,function(e,t){var n=[],r=Object.getPrototypeOf,o=n.slice,i=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,l=n.indexOf,s={},u=s.toString,c=s.hasOwnProperty,d=c.toString,p=d.call(Object),f={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},v=function(e){return null!=e&&e===e.window},h=e.document,g={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var r,o,i=(n=n||h).createElement("script");if(i.text=e,t)for(r in g)(o=t[r]||t.getAttribute&&t.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function E(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[u.call(e)]||"object":typeof e}var S=function(e,t){return new S.fn.init(e,t)};function b(e){var t=!!e&&"length"in e&&e.length,n=E(e);return!m(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},l=1,s=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[l]||{},l++),"object"==typeof a||m(a)||(a={}),l===s&&(a=this,l--);l<s;l++)if(null!=(e=arguments[l]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(S.isPlainObject(r)||(o=Array.isArray(r)))?(n=a[t],i=o&&!Array.isArray(n)?[]:o||S.isPlainObject(n)?n:{},o=!1,a[t]=S.extend(u,i,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e)||(t=r(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){y(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(b(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?S.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:l.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;r<n;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r=[],o=0,i=e.length,a=!n;o<i;o++)!t(e[o],o)!==a&&r.push(e[o]);return r},map:function(e,t,n){var r,o,a=0,l=[];if(b(e))for(r=e.length;a<r;a++)null!=(o=t(e[a],a,n))&&l.push(o);else for(a in e)null!=(o=t(e[a],a,n))&&l.push(o);return i(l)},guid:1,support:f}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var _=function(e){var t,n,r,o,i,a,l,s,u,c,d,p,f,m,v,h,g,y,E,S="sizzle"+1*new Date,b=e.document,_=0,A=0,D=se(),C=se(),T=se(),x=se(),N=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],L=I.pop,k=I.push,O=I.push,R=I.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\["+B+"*("+F+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+B+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",U=new RegExp(B+"+","g"),z=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),W=new RegExp("^"+B+"*,"+B+"*"),q=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),V=new RegExp(B+"|>"),G=new RegExp(H),K=new RegExp("^"+F+"$"),Y={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},$=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){p()},ae=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(I=R.call(b.childNodes),b.childNodes)}catch(e){O={apply:I.length?function(e,t){k.apply(e,R.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function le(e,t,r,o){var i,l,u,c,d,m,g,y=t&&t.ownerDocument,b=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return r;if(!o&&(p(t),t=t||f,v)){if(11!==b&&(d=Q.exec(e)))if(i=d[1]){if(9===b){if(!(u=t.getElementById(i)))return r;if(u.id===i)return r.push(u),r}else if(y&&(u=y.getElementById(i))&&E(t,u)&&u.id===i)return r.push(u),r}else{if(d[2])return O.apply(r,t.getElementsByTagName(e)),r;if((i=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(i)),r}if(n.qsa&&!x[e+" "]&&(!h||!h.test(e))&&(1!==b||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===b&&(V.test(e)||q.test(e))){for((y=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,oe):t.setAttribute("id",c=S)),l=(m=a(e)).length;l--;)m[l]=(c?"#"+c:":scope")+" "+Ee(m[l]);g=m.join(",")}try{return O.apply(r,y.querySelectorAll(g)),r}catch(t){x(e,!0)}finally{c===S&&t.removeAttribute("id")}}}return s(e.replace(z,"$1"),t,r,o)}function se(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function ue(e){return e[S]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ve(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return ue(function(t){return t=+t,ue(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=le.support={},i=le.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!$.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=le.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:b;return a!=f&&9===a.nodeType&&a.documentElement?(m=(f=a).documentElement,v=!i(f),b!=f&&(o=f.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),n.scope=ce(function(e){return m.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(f.getElementsByClassName),n.getById=ce(function(e){return m.appendChild(e).id=S,!f.getElementsByName||!f.getElementsByName(S).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&v)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=J.test(f.querySelectorAll))&&(ce(function(e){var t;m.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+B+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+S+"-]").length||h.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(y=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",H)}),h=h.length&&new RegExp(h.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(m.compareDocumentPosition),E=t||J.test(m.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==b&&E(b,e)?-1:t==f||t.ownerDocument==b&&E(b,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],l=[t];if(!o||!i)return e==f?-1:t==f?1:o?-1:i?1:c?P(c,e)-P(c,t):0;if(o===i)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[r]===l[r];)r++;return r?pe(a[r],l[r]):a[r]==b?-1:l[r]==b?1:0},f):f},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&v&&!x[t+" "]&&(!g||!g.test(t))&&(!h||!h.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){x(t,!0)}return le(t,f,null,[e]).length>0},le.contains=function(e,t){return(e.ownerDocument||e)!=f&&p(e),E(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=f&&p(e);var o=r.attrHandle[t.toLowerCase()],i=o&&w.call(r.attrHandle,t.toLowerCase())?o(e,t,!v):void 0;return void 0!==i?i:n.attributes||!v?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},le.escape=function(e){return(e+"").replace(re,oe)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],o=0,i=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),d){for(;t=e[i++];)t===e[i]&&(o=r.push(i));for(;o--;)e.splice(r[o],1)}return c=null,e},o=le.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(r=le.selectors={cacheLength:50,createPseudo:ue,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=D[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&D(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=le.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,s){var u,c,d,p,f,m,v=i!==a?"nextSibling":"previousSibling",h=t.parentNode,g=l&&t.nodeName.toLowerCase(),y=!s&&!l,E=!1;if(h){if(i){for(;v;){for(p=t;p=p[v];)if(l?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;m=v="only"===e&&!m&&"nextSibling"}return!0}if(m=[a?h.firstChild:h.lastChild],a&&y){for(E=(f=(u=(c=(d=(p=h)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],p=f&&h.childNodes[f];p=++f&&p&&p[v]||(E=f=0)||m.pop();)if(1===p.nodeType&&++E&&p===t){c[e]=[_,f,E];break}}else if(y&&(E=f=(u=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===E)for(;(p=++f&&p&&p[v]||(E=f=0)||m.pop())&&((l?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++E||(y&&((c=(d=p[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[_,E]),p!==t)););return(E-=o)===r||E%r==0&&E/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return o[S]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)e[r=P(e,i[a])]=!(n[r]=i[a])}):function(e){return o(e,0,n)}):o}},pseudos:{not:ue(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[S]?ue(function(e,t,n,o){for(var i,a=r(e,null,o,[]),l=e.length;l--;)(i=a[l])&&(e[l]=!(t[l]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:ue(function(e){return function(t){return le(e,t).length>0}}),contains:ue(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||o(t)).indexOf(e)>-1}}),lang:ue(function(e){return K.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ve(!1),disabled:ve(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=me(t);function ye(){}function Ee(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Se(e,t,n){var r=t.dir,o=t.next,i=o||r,a=n&&"parentNode"===i,l=A++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,o);return!1}:function(t,n,s){var u,c,d,p=[_,l];if(s){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(d=t[S]||(t[S]={}))[t.uniqueID]||(d[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[i])&&u[0]===_&&u[1]===l)return p[2]=u[2];if(c[i]=p,p[2]=e(t,n,s))return!0}return!1}}function be(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function _e(e,t,n,r,o){for(var i,a=[],l=0,s=e.length,u=null!=t;l<s;l++)(i=e[l])&&(n&&!n(i,r,o)||(a.push(i),u&&t.push(l)));return a}function Ae(e,t,n,r,o,i){return r&&!r[S]&&(r=Ae(r)),o&&!o[S]&&(o=Ae(o,i)),ue(function(i,a,l,s){var u,c,d,p=[],f=[],m=a.length,v=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)le(e,t[r],n);return n}(t||"*",l.nodeType?[l]:l,[]),h=!e||!i&&t?v:_e(v,p,e,l,s),g=n?o||(i?e:m||r)?[]:a:h;if(n&&n(h,g,l,s),r)for(u=_e(g,f),r(u,[],l,s),c=u.length;c--;)(d=u[c])&&(g[f[c]]=!(h[f[c]]=d));if(i){if(o||e){if(o){for(u=[],c=g.length;c--;)(d=g[c])&&u.push(h[c]=d);o(null,g=[],u,s)}for(c=g.length;c--;)(d=g[c])&&(u=o?P(i,d):p[c])>-1&&(i[u]=!(a[u]=d))}}else g=_e(g===a?g.splice(m,g.length):g),o?o(null,a,g,s):O.apply(a,g)})}function De(e){for(var t,n,o,i=e.length,a=r.relative[e[0].type],l=a||r.relative[" "],s=a?1:0,c=Se(function(e){return e===t},l,!0),d=Se(function(e){return P(t,e)>-1},l,!0),p=[function(e,n,r){var o=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,o}];s<i;s++)if(n=r.relative[e[s].type])p=[Se(be(p),n)];else{if((n=r.filter[e[s].type].apply(null,e[s].matches))[S]){for(o=++s;o<i&&!r.relative[e[o].type];o++);return Ae(s>1&&be(p),s>1&&Ee(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(z,"$1"),n,s<o&&De(e.slice(s,o)),o<i&&De(e=e.slice(o)),o<i&&Ee(e))}p.push(n)}return be(p)}return ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=le.tokenize=function(e,t){var n,o,i,a,l,s,u,c=C[e+" "];if(c)return t?0:c.slice(0);for(l=e,s=[],u=r.preFilter;l;){for(a in n&&!(o=W.exec(l))||(o&&(l=l.slice(o[0].length)||l),s.push(i=[])),n=!1,(o=q.exec(l))&&(n=o.shift(),i.push({value:n,type:o[0].replace(z," ")}),l=l.slice(n.length)),r.filter)!(o=Y[a].exec(l))||u[a]&&!(o=u[a](o))||(n=o.shift(),i.push({value:n,type:a,matches:o}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):C(e,s).slice(0)},l=le.compile=function(e,t){var n,o=[],i=[],l=T[e+" "];if(!l){for(t||(t=a(e)),n=t.length;n--;)(l=De(t[n]))[S]?o.push(l):i.push(l);(l=T(e,function(e,t){var n=t.length>0,o=e.length>0,i=function(i,a,l,s,c){var d,m,h,g=0,y="0",E=i&&[],S=[],b=u,A=i||o&&r.find.TAG("*",c),D=_+=null==b?1:Math.random()||.1,C=A.length;for(c&&(u=a==f||a||c);y!==C&&null!=(d=A[y]);y++){if(o&&d){for(m=0,a||d.ownerDocument==f||(p(d),l=!v);h=e[m++];)if(h(d,a||f,l)){s.push(d);break}c&&(_=D)}n&&((d=!h&&d)&&g--,i&&E.push(d))}if(g+=y,n&&y!==g){for(m=0;h=t[m++];)h(E,S,a,l);if(i){if(g>0)for(;y--;)E[y]||S[y]||(S[y]=L.call(s));S=_e(S)}O.apply(s,S),c&&!i&&S.length>0&&g+t.length>1&&le.uniqueSort(s)}return c&&(_=D,u=b),E};return n?ue(i):i}(i,o))).selector=e}return l},s=le.select=function(e,t,n,o){var i,s,u,c,d,p="function"==typeof e&&e,f=!o&&a(e=p.selector||e);if(n=n||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(u=s[0]).type&&9===t.nodeType&&v&&r.relative[s[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(i=Y.needsContext.test(e)?0:s.length;i--&&!r.relative[c=(u=s[i]).type];)if((d=r.find[c])&&(o=d(u.matches[0].replace(te,ne),ee.test(s[0].type)&&ge(t.parentNode)||t))){if(s.splice(i,1),!(e=o.length&&Ee(s)))return O.apply(n,o),n;break}}return(p||l(e,f))(o,t,!v,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=S.split("").sort(N).join("")===S,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),le}(e);S.find=_,S.expr=_.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=_.uniqueSort,S.text=_.getText,S.isXMLDoc=_.isXML,S.contains=_.contains,S.escapeSelector=_.escape;var A=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&S(e).is(n))break;r.push(e)}return r},D=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},C=S.expr.match.needsContext;function T(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var x=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(e,t,n){return m(t)?S.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return l.call(t,e)>-1!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(o[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,o[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(N(this,e||[],!1))},not:function(e){return this.pushStack(N(this,e||[],!0))},is:function(e){return!!N(this,"string"==typeof e&&C.test(e)?S(e):e||[],!1).length}});var w,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||w,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(S.merge(this,S.parseHTML(r[1],(t=t instanceof S?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),x.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=h.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(h);var L=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,o=this.length,i=[],a="string"!=typeof e&&S(e);if(!C.test(e))for(;r<o;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?S.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?l.call(S(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,n){return A(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,n){return A(e,"nextSibling",n)},prevUntil:function(e,t,n){return A(e,"previousSibling",n)},siblings:function(e){return D((e.parentNode||{}).firstChild,e)},children:function(e){return D(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(T(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,r){var o=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=S.filter(r,o)),this.length>1&&(k[e]||S.uniqueSort(o),L.test(e)&&o.reverse()),this.pushStack(o)}});var R=/[^\x20\t\r\n\f]+/g;function P(e){return e}function M(e){throw e}function B(e,t,n,r){var o;try{e&&m(o=e.promise)?o.call(e).done(t).fail(n):e&&m(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):S.extend({},e);var t,n,r,o,i=[],a=[],l=-1,s=function(){for(o=o||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l<i.length;)!1===i[l].apply(n[0],n[1])&&e.stopOnFalse&&(l=i.length,n=!1);e.memory||(n=!1),t=!1,o&&(i=n?[]:"")},u={add:function(){return i&&(n&&!t&&(l=i.length-1,a.push(n)),function t(n){S.each(n,function(n,r){m(r)?e.unique&&u.has(r)||i.push(r):r&&r.length&&"string"!==E(r)&&t(r)})}(arguments),n&&!t&&s()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,i,n))>-1;)i.splice(n,1),n<=l&&l--}),this},has:function(e){return e?S.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||s()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},S.extend({Deferred:function(t){var n=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return S.Deferred(function(t){S.each(n,function(n,r){var o=m(e[r[4]])&&e[r[4]];i[r[1]](function(){var e=o&&o.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,r,o){var i=0;function a(t,n,r,o){return function(){var l=this,s=arguments,u=function(){var e,u;if(!(t<i)){if((e=r.apply(l,s))===n.promise())throw new TypeError("Thenable self-resolution");m(u=e&&("object"==typeof e||"function"==typeof e)&&e.then)?o?u.call(e,a(i,n,P,o),a(i,n,M,o)):(i++,u.call(e,a(i,n,P,o),a(i,n,M,o),a(i,n,P,n.notifyWith))):(r!==P&&(l=void 0,s=[e]),(o||n.resolveWith)(l,s))}},c=o?u:function(){try{u()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,c.stackTrace),t+1>=i&&(r!==M&&(l=void 0,s=[e]),n.rejectWith(l,s))}};t?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),e.setTimeout(c))}}return S.Deferred(function(e){n[0][3].add(a(0,e,m(o)?o:P,e.notifyWith)),n[1][3].add(a(0,e,m(t)?t:P)),n[2][3].add(a(0,e,m(r)?r:M))}).promise()},promise:function(e){return null!=e?S.extend(e,o):o}},i={};return S.each(n,function(e,t){var a=t[2],l=t[5];o[t[1]]=a.add,l&&a.add(function(){r=l},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),i[t[0]]=function(){return i[t[0]+"With"](this===i?void 0:this,arguments),this},i[t[0]+"With"]=a.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=S.Deferred(),l=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(B(e,a.done(l(n)).resolve,a.reject,!t),"pending"===a.state()||m(i[n]&&i[n].then)))return a.then();for(;n--;)B(i[n],l(n),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout(function(){throw t})};var j=S.Deferred();function H(){h.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),S.ready()}S.fn.ready=function(e){return j.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||j.resolveWith(h,[S]))}}),S.ready.then=j.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(S.ready):(h.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var U=function(e,t,n,r,o,i,a){var l=0,s=e.length,u=null==n;if("object"===E(n))for(l in o=!0,n)U(e,t,l,n[l],!0,i,a);else if(void 0!==r&&(o=!0,m(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(S(e),n)})),t))for(;l<s;l++)t(e[l],n,a?r:r.call(e[l],l,t(e[l],n)));return o?e:u?t.call(e):s?t(e[0],n):i},z=/^-ms-/,W=/-([a-z])/g;function q(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(W,q)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=S.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,o=this.cache(e);if("string"==typeof t)o[V(t)]=n;else for(r in t)o[V(r)]=t[r];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new K,$=new K,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}$.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return $.hasData(e)||Y.hasData(e)},data:function(e,t,n){return $.access(e,t,n)},removeData:function(e,t){$.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===e){if(this.length&&(o=$.get(i),1===i.nodeType&&!Y.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=V(r.slice(5)),J(i,r,o[r]));Y.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){$.set(this,e)}):U(this,function(t){var n;if(i&&void 0===t)return void 0!==(n=$.get(i,e))||void 0!==(n=J(i,e))?n:void 0;this.each(function(){$.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){$.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return r=Y.get(e,t=(t||"fx")+"queue"),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){var n=S.queue(e,t=t||"fx"),r=n.length,o=n.shift(),i=S._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,function(){S.dequeue(e,t)},i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,o=S.Deferred(),i=this,a=this.length,l=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(i[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(l));return l(),o.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,re=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};ne.getRootNode&&(re=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ie=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&re(e)&&"none"===S.css(e,"display")};function ae(e,t,n,r){var o,i,a=20,l=r?function(){return r.cur()}:function(){return S.css(e,t,"")},s=l(),u=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==u&&+s)&&ee.exec(S.css(e,t));if(c&&c[3]!==u){for(u=u||c[3],c=+(s/=2)||1;a--;)S.style(e,t,c+u),(1-i)*(1-(i=l()/s||.5))<=0&&(a=0),c/=i;S.style(e,t,(c*=2)+u),n=n||[]}return n&&(c=+c||+s||0,o=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=o)),o}var le={};function se(e){var t,n=e.ownerDocument,r=e.nodeName,o=le[r];return o||(t=n.body.appendChild(n.createElement(r)),o=S.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),le[r]=o,o)}function ue(e,t){for(var n,r,o=[],i=0,a=e.length;i<a;i++)(r=e[i]).style&&(n=r.style.display,t?("none"===n&&(o[i]=Y.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&ie(r)&&(o[i]=se(r))):"none"!==n&&(o[i]="none",Y.set(r,"display",n)));for(i=0;i<a;i++)null!=o[i]&&(e[i].style.display=o[i]);return e}S.fn.extend({show:function(){return ue(this,!0)},hide:function(){return ue(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ie(this)?S(this).show():S(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,fe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),f.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",f.option=!!ce.lastChild;var ve={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&T(e,t)?S.merge([e],n):n}function ge(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ve.tbody=ve.tfoot=ve.colgroup=ve.caption=ve.thead,ve.th=ve.td,f.option||(ve.optgroup=ve.option=[1,"<select multiple='multiple'>","</select>"]);var ye=/<|&#?\w+;/;function Ee(e,t,n,r,o){for(var i,a,l,s,u,c,d=t.createDocumentFragment(),p=[],f=0,m=e.length;f<m;f++)if((i=e[f])||0===i)if("object"===E(i))S.merge(p,i.nodeType?[i]:i);else if(ye.test(i)){for(a=a||d.appendChild(t.createElement("div")),l=(fe.exec(i)||["",""])[1].toLowerCase(),a.innerHTML=(s=ve[l]||ve._default)[1]+S.htmlPrefilter(i)+s[2],c=s[0];c--;)a=a.lastChild;S.merge(p,a.childNodes),(a=d.firstChild).textContent=""}else p.push(t.createTextNode(i));for(d.textContent="",f=0;i=p[f++];)if(r&&S.inArray(i,r)>-1)o&&o.push(i);else if(u=re(i),a=he(d.appendChild(i),"script"),u&&ge(a),n)for(c=0;i=a[c++];)me.test(i.type||"")&&n.push(i);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function _e(){return!1}function Ae(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function De(e,t,n,r,o,i){var a,l;if("object"==typeof t){for(l in"string"!=typeof n&&(r=r||n,n=void 0),t)De(e,l,n,r,t[l],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=_e;else if(!o)return e;return 1===i&&(a=o,(o=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,o,r,n)})}function Ce(e,t,n){n?(Y.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,i,a=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=o.call(arguments),Y.set(this,t,a),r=n(this,t),this[t](),a!==(i=Y.get(this,t))||r?Y.set(this,t,!1):i={},a!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else a.length&&(Y.set(this,t,{value:S.event.trigger(S.extend(a[0],S.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&S.event.add(e,t,be)}S.event={global:{},add:function(e,t,n,r,o){var i,a,l,s,u,c,d,p,f,m,v,h=Y.get(e);if(G(e))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&S.find.matchesSelector(ne,o),n.guid||(n.guid=S.guid++),(s=h.events)||(s=h.events=Object.create(null)),(a=h.handle)||(a=h.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(R)||[""]).length;u--;)f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f&&(d=S.event.special[f]||{},d=S.event.special[f=(o?d.delegateType:d.bindType)||f]||{},c=S.extend({type:f,origType:v,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&S.expr.match.needsContext.test(o),namespace:m.join(".")},i),(p=s[f])||((p=s[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,m,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[f]=!0)},remove:function(e,t,n,r,o){var i,a,l,s,u,c,d,p,f,m,v,h=Y.hasData(e)&&Y.get(e);if(h&&(s=h.events)){for(u=(t=(t||"").match(R)||[""]).length;u--;)if(f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f){for(d=S.event.special[f]||{},p=s[f=(r?d.delegateType:d.bindType)||f]||[],l=l[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=p.length;i--;)c=p[i],!o&&v!==c.origType||n&&n.guid!==c.guid||l&&!l.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(i,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,h.handle)||S.removeEvent(e,f,h.handle),delete s[f])}else for(f in s)S.event.remove(e,f+t[u],n,r,!0);S.isEmptyObject(s)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,l=new Array(arguments.length),s=S.event.fix(e),u=(Y.get(this,"events")||Object.create(null))[s.type]||[],c=S.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=S.event.handlers.call(this,s,u),t=0;(o=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==i.namespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(r=((S.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,o,i,a,l=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(i=[],a={},n=0;n<s;n++)void 0===a[o=(r=t[n]).selector+" "]&&(a[o]=r.needsContext?S(o,this).index(u)>-1:S.find(o,this,null,[u]).length),a[o]&&i.push(r);i.length&&l.push({elem:u,handlers:i})}return u=this,s<t.length&&l.push({elem:u,handlers:t.slice(s)}),l},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click",be),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&T(t,"input")&&Y.get(t,"click")||T(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:_e,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:_e,isPropagationStopped:_e,isImmediatePropagationStopped:_e,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ce(this,e,Ae),!1},trigger:function(){return Ce(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,i=e.handleObj;return o&&(o===r||S.contains(r,o))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=_e),this.each(function(){S.event.remove(this,e,n,t)})}});var Te=/<script|<style|<link/i,xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function we(e,t){return T(e,"table")&&T(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function ke(e,t){var n,r,o,i,a,l;if(1===t.nodeType){if(Y.hasData(e)&&(l=Y.get(e).events))for(o in Y.remove(t,"handle events"),l)for(n=0,r=l[o].length;n<r;n++)S.event.add(t,o,l[o][n]);$.hasData(e)&&(i=$.access(e),a=S.extend({},i),$.set(t,a))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=i(t);var o,a,l,s,u,c,d=0,p=e.length,v=p-1,h=t[0],g=m(h);if(g||p>1&&"string"==typeof h&&!f.checkClone&&xe.test(h))return e.each(function(o){var i=e.eq(o);g&&(t[0]=h.call(this,o,i.html())),Re(i,t,n,r)});if(p&&(a=(o=Ee(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=a),a||r)){for(s=(l=S.map(he(o,"script"),Ie)).length;d<p;d++)u=o,d!==v&&(u=S.clone(u,!0,!0),s&&S.merge(l,he(u,"script"))),n.call(e[d],u,d);if(s)for(c=l[l.length-1].ownerDocument,S.map(l,Le),d=0;d<s;d++)me.test((u=l[d]).type||"")&&!Y.access(u,"globalEval")&&S.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):y(u.textContent.replace(Ne,""),u,c))}return e}function Pe(e,t,n){for(var r,o=t?S.filter(t,e):e,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||S.cleanData(he(r)),r.parentNode&&(n&&re(r)&&ge(he(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,o,i,a,l=e.cloneNode(!0),s=re(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=he(l),r=0,o=(i=he(e)).length;r<o;r++)Oe(i[r],a[r]);if(t)if(n)for(i=i||he(e),a=a||he(l),r=0,o=i.length;r<o;r++)ke(i[r],a[r]);else ke(e,l);return(a=he(l,"script")).length>0&&ge(a,!s&&he(e,"script")),l},cleanData:function(e){for(var t,n,r,o=S.event.special,i=0;void 0!==(n=e[i]);i++)if(G(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)o[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[$.expando]&&(n[$.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Pe(this,e,!0)},remove:function(e){return Pe(this,e)},text:function(e){return U(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||we(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=we(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return U(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Te.test(e)&&!ve[(fe.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,r=[],o=S(e),i=o.length-1,l=0;l<=i;l++)n=l===i?this:this.clone(!0),S(o[l])[t](n),a.apply(r,n.get());return this.pushStack(r)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Be=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=function(e,t,n){var r,o,i={};for(o in t)i[o]=e.style[o],e.style[o]=t[o];for(o in r=n.call(e),t)e.style[o]=i[o];return r},je=new RegExp(te.join("|"),"i");function He(e,t,n){var r,o,i,a,l=e.style;return(n=n||Be(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||re(e)||(a=S.style(e,t)),!f.pixelBoxStyles()&&Me.test(a)&&je.test(t)&&(r=l.width,o=l.minWidth,i=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=o,l.maxWidth=i)),void 0!==a?a+"":a}function Ue(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,s=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),o=36===n(t.width),c.style.position="absolute",i=12===n(c.offsetWidth/3),ne.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,o,i,a,l,s,u=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(f,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,n,r,o;return null==l&&(t=h.createElement("table"),n=h.createElement("tr"),r=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",ne.appendChild(t).appendChild(n).appendChild(r),o=e.getComputedStyle(n),l=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),l}}))}();var ze=["Webkit","Moz","ms"],We=h.createElement("div").style,qe={};function Ve(e){return S.cssProps[e]||qe[e]||(e in We?e:qe[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=ze.length;n--;)if((e=ze[n]+t)in We)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ke=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},$e={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var r=ee.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,o,i){var a="width"===t?1:0,l=0,s=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(s+=S.css(e,n+te[a],!0,o)),r?("content"===n&&(s-=S.css(e,"padding"+te[a],!0,o)),"margin"!==n&&(s-=S.css(e,"border"+te[a]+"Width",!0,o))):(s+=S.css(e,"padding"+te[a],!0,o),"padding"!==n?s+=S.css(e,"border"+te[a]+"Width",!0,o):l+=S.css(e,"border"+te[a]+"Width",!0,o));return!r&&i>=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-s-l-.5))||0),s}function Je(e,t,n){var r=Be(e),o=(!f.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),i=o,a=He(e,t,r),l="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!f.boxSizingReliable()&&o||!f.reliableTrDimensions()&&T(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===S.css(e,"boxSizing",!1,r),(i=l in e)&&(a=e[l])),(a=parseFloat(a)||0)+Ze(e,t,n||(o?"border":"content"),i,r,a)+"px"}function Qe(e,t,n,r,o){return new Qe.prototype.init(e,t,n,r,o)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=He(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,l=V(t),s=Ke.test(t),u=e.style;if(s||(t=Ve(l)),a=S.cssHooks[t]||S.cssHooks[l],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:u[t];"string"==(i=typeof n)&&(o=ee.exec(n))&&o[1]&&(n=ae(e,t,o),i="number"),null!=n&&n==n&&("number"!==i||s||(n+=o&&o[3]||(S.cssNumber[l]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(s?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var o,i,a,l=V(t);return Ke.test(t)||(t=Ve(l)),(a=S.cssHooks[t]||S.cssHooks[l])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=He(e,t,r)),"normal"===o&&t in $e&&(o=$e[t]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,r):Fe(e,Ye,function(){return Je(e,t,r)})},set:function(e,n,r){var o,i=Be(e),a=!f.scrollboxSize()&&"absolute"===i.position,l=(a||r)&&"border-box"===S.css(e,"boxSizing",!1,i),s=r?Ze(e,t,r,l,i):0;return l&&a&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-Ze(e,t,"border",!1,i)-.5)),s&&(o=ee.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),Xe(0,n,s)}}}),S.cssHooks.marginLeft=Ue(f.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+te[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(S.cssHooks[e+t].set=Xe)}),S.fn.extend({css:function(e,t){return U(this,function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=Be(e),o=t.length;a<o;a++)i[t[a]]=S.css(e,t[a],!1,r);return i}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,arguments.length>1)}}),S.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(S.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Qe.prototype.init,S.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=/queueHooks$/;function ot(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(ot):e.setTimeout(ot,S.fx.interval),S.fx.tick())}function it(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function at(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=te[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function lt(e,t,n){for(var r,o=(st.tweeners[t]||[]).concat(st.tweeners["*"]),i=0,a=o.length;i<a;i++)if(r=o[i].call(n,t,e))return r}function st(e,t,n){var r,o,i=0,a=st.prefilters.length,l=S.Deferred().always(function(){delete s.elem}),s=function(){if(o)return!1;for(var t=et||it(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),i=0,a=u.tweens.length;i<a;i++)u.tweens[i].run(r);return l.notifyWith(e,[u,r,n]),r<1&&a?n:(a||l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u]),!1)},u=l.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||it(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)u.tweens[n].run(1);return t?(l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u,t])):l.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,o,i,a;for(n in e)if(o=t[r=V(n)],i=e[n],Array.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in i=a.expand(i),delete e[r],i)n in e||(e[n]=i[n],t[n]=o);else t[r]=o}(c,u.opts.specialEasing);i<a;i++)if(r=st.prefilters[i].call(u,e,c,u.opts))return m(r.stop)&&(S._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return S.map(c,lt,u),m(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),S.fx.timer(S.extend(s,{elem:e,anim:u,queue:u.opts.queue})),u}S.Animation=S.extend(st,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ae(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,o=e.length;r<o;r++)(st.tweeners[n=e[r]]=st.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var r,o,i,a,l,s,u,c,d="width"in t||"height"in t,p=this,f={},m=e.style,v=e.nodeType&&ie(e),h=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(nt.test(o=t[r])){if(delete t[r],i=i||"toggle"===o,o===(v?"hide":"show")){if("show"!==o||!h||void 0===h[r])continue;v=!0}f[r]=h&&h[r]||S.style(e,r)}if((s=!S.isEmptyObject(t))||!S.isEmptyObject(f))for(r in d&&1===e.nodeType&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],null==(u=h&&h.display)&&(u=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(u?c=u:(ue([e],!0),u=e.style.display||u,c=S.css(e,"display"),ue([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===S.css(e,"float")&&(s||(p.done(function(){m.display=u}),null==u&&(u="none"===(c=m.display)?"":c)),m.display="inline-block")),n.overflow&&(m.overflow="hidden",p.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]})),s=!1,f)s||(h?"hidden"in h&&(v=h.hidden):h=Y.access(e,"fxshow",{display:u}),i&&(h.hidden=!v),v&&ue([e],!0),p.done(function(){for(r in v||ue([e]),Y.remove(e,"fxshow"),f)S.style(e,r,f[r])})),s=lt(v?h[r]:0,r,p),r in h||(h[r]=s.start,v&&(s.end=s.start,s.start=0))}],prefilter:function(e,t){t?st.prefilters.unshift(e):st.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration=r.duration in S.fx.speeds?S.fx.speeds[r.duration]:S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ie).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=S.isEmptyObject(e),i=S.speed(t,n,r),a=function(){var t=st(this,S.extend({},e),i);(o||Y.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||!1===i.queue?this.each(a):this.queue(i.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",i=S.timers,a=Y.get(this);if(o)a[o]&&a[o].stop&&r(a[o]);else for(o in a)a[o]&&a[o].stop&&rt.test(o)&&r(a[o]);for(o=i.length;o--;)i[o].elem!==this||null!=e&&i[o].queue!==e||(i[o].anim.stop(n),t=!1,i.splice(o,1));!t&&n||S.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Y.get(this),r=n[e+"queue"],o=n[e+"queueHooks"],i=S.timers,a=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),S.each(["toggle","show","hide"],function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(at(t,!0),e,r,o)}}),S.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),et=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){tt||(tt=!0,ot())},S.fx.stop=function(){tt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,r){var o=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(o)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var ut,ct=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return U(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?S.prop(e,t,n):(1===i&&S.isXMLDoc(e)||(o=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&T(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(R);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),ut={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||S.find.attr;ct[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=ct[a],ct[a]=o,o=null!=n(e,t,r)?a:null,ct[a]=i),o}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function ft(e){return(e.match(R)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}S.fn.extend({prop:function(e,t){return U(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(e)||(o=S.propHooks[t=S.propFix[t]||t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(S.propHooks.selected={get:function(e){return null},set:function(e){}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,r,o,i,a,l,s=0;if(m(e))return this.each(function(t){S(this).addClass(e.call(this,t,mt(this)))});if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},removeClass:function(e){var t,n,r,o,i,a,l,s=0;if(m(e))return this.each(function(t){S(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,o,i,a;if(r)for(o=0,i=S(this),a=vt(e);t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=mt(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+ft(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;S.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=m(e),this.each(function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,S(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=S.map(o,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=S.valHooks[o.type]||S.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(ht,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ft(S.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,l=a?null:[],s=a?i+1:o.length;for(r=i<0?s:a?i:0;r<s;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!T(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;l.push(t)}return l},set:function(e,t){for(var n,r,o=e.options,i=S.makeArray(t),a=o.length;a--;)((r=o[a]).selected=S.inArray(S.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},f.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),f.focusin="onfocusin"in e;var gt=/^(?:focusinfocus|focusoutblur)$/,yt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,r,o){var i,a,l,s,u,d,p,f,g=[r||h],y=c.call(t,"type")?t.type:t,E=c.call(t,"namespace")?t.namespace.split("."):[];if(a=f=l=r=r||h,3!==r.nodeType&&8!==r.nodeType&&!gt.test(y+S.event.triggered)&&(y.indexOf(".")>-1&&(E=y.split("."),y=E.shift(),E.sort()),u=y.indexOf(":")<0&&"on"+y,(t=t[S.expando]?t:new S.Event(y,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=E.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:S.makeArray(n,[t]),p=S.event.special[y]||{},o||!p.trigger||!1!==p.trigger.apply(r,n))){if(!o&&!p.noBubble&&!v(r)){for(gt.test((s=p.delegateType||y)+y)||(a=a.parentNode);a;a=a.parentNode)g.push(a),l=a;l===(r.ownerDocument||h)&&g.push(l.defaultView||l.parentWindow||e)}for(i=0;(a=g[i++])&&!t.isPropagationStopped();)f=a,t.type=i>1?s:p.bindType||y,(d=(Y.get(a,"events")||Object.create(null))[t.type]&&Y.get(a,"handle"))&&d.apply(a,n),(d=u&&a[u])&&d.apply&&G(a)&&(t.result=d.apply(a,n),!1===t.result&&t.preventDefault());return t.type=y,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(g.pop(),n)||!G(r)||u&&m(r[y])&&!v(r)&&((l=r[u])&&(r[u]=null),S.event.triggered=y,t.isPropagationStopped()&&f.addEventListener(y,yt),r[y](),t.isPropagationStopped()&&f.removeEventListener(y,yt),S.event.triggered=void 0,l&&(r[u]=l)),t.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),f.focusin||S.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,o=Y.access(r,t);o||r.addEventListener(e,n,!0),Y.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=Y.access(r,t)-1;o?Y.access(r,t,o):(r.removeEventListener(e,n,!0),Y.remove(r,t))}}});var Et=e.location,St={guid:Date.now()},bt=/\?/;S.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var _t=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;function Tt(e,t,n,r){var o;if(Array.isArray(t))S.each(t,function(t,o){n||_t.test(e)?r(e,o):Tt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==E(t))r(e,t);else for(o in t)Tt(e+"["+o+"]",t[o],n,r)}S.param=function(e,t){var n,r=[],o=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){o(this.name,this.value)});else for(n in e)Tt(n,e[n],t,o);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Ct.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var xt=/%20/g,Nt=/#.*$/,wt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,kt=/^\/\//,Ot={},Rt={},Pt="*/".concat("*"),Mt=h.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(R)||[];if(m(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ft(e,t,n,r){var o={},i=e===Rt;function a(l){var s;return o[l]=!0,S.each(e[l]||[],function(e,l){var u=l(t,n,r);return"string"!=typeof u||i||o[u]?i?!(s=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),s}return a(t.dataTypes[0])||!o["*"]&&a("*")}function jt(e,t){var n,r,o=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=Et.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?jt(jt(e,S.ajaxSettings),t):jt(S.ajaxSettings,e)},ajaxPrefilter:Bt(Ot),ajaxTransport:Bt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var r,o,i,a,l,s,u,c,d,p,f=S.ajaxSetup({},n=n||{}),m=f.context||f,v=f.context&&(m.nodeType||m.jquery)?S(m):S.event,g=S.Deferred(),y=S.Callbacks("once memory"),E=f.statusCode||{},b={},_={},A="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=It.exec(i);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?i:null},setRequestHeader:function(e,t){return null==u&&(e=_[e.toLowerCase()]=_[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)D.always(e[D.status]);else for(t in e)E[t]=[E[t],e[t]];return this},abort:function(e){var t=e||A;return r&&r.abort(t),C(0,t),this}};if(g.promise(D),f.url=((t||f.url||Et.href)+"").replace(kt,Et.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(R)||[""],null==f.crossDomain){s=h.createElement("a");try{s.href=f.url,s.href=s.href,f.crossDomain=Mt.protocol+"//"+Mt.host!=s.protocol+"//"+s.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),Ft(Ot,f,n,D),u)return D;for(d in(c=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Lt.test(f.type),o=f.url.replace(Nt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(xt,"+")):(p=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(bt.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(wt,"$1"),p=(bt.test(o)?"&":"?")+"_="+St.guid+++p),f.url=o+p),f.ifModified&&(S.lastModified[o]&&D.setRequestHeader("If-Modified-Since",S.lastModified[o]),S.etag[o]&&D.setRequestHeader("If-None-Match",S.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&D.setRequestHeader("Content-Type",f.contentType),D.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Pt+"; q=0.01":""):f.accepts["*"]),f.headers)D.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(m,D,f)||u))return D.abort();if(A="abort",y.add(f.complete),D.done(f.success),D.fail(f.error),r=Ft(Rt,f,n,D)){if(D.readyState=1,c&&v.trigger("ajaxSend",[D,f]),u)return D;f.async&&f.timeout>0&&(l=e.setTimeout(function(){D.abort("timeout")},f.timeout));try{u=!1,r.send(b,C)}catch(e){if(u)throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,n,a,s){var d,p,h,b,_,A=n;u||(u=!0,l&&e.clearTimeout(l),r=void 0,i=s||"",D.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(b=function(e,t,n){for(var r,o,i,a,l=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){s.unshift(o);break}if(s[0]in n)i=s[0];else{for(o in n){if(!s[0]||e.converters[o+" "+s[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==s[0]&&s.unshift(i),n[i]}(f,D,a)),!d&&S.inArray("script",f.dataTypes)>-1&&S.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(e,t,n,r){var o,i,a,l,s,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(i=c.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!s&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=i,i=c.shift())if("*"===i)i=s;else if("*"!==s&&s!==i){if(!(a=u[s+" "+i]||u["* "+i]))for(o in u)if((l=o.split(" "))[1]===i&&(a=u[s+" "+l[0]]||u["* "+l[0]])){!0===a?a=u[o]:!0!==u[o]&&(i=l[0],c.unshift(l[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+s+" to "+i}}}return{state:"success",data:t}}(f,b,D,d),d?(f.ifModified&&((_=D.getResponseHeader("Last-Modified"))&&(S.lastModified[o]=_),(_=D.getResponseHeader("etag"))&&(S.etag[o]=_)),204===t||"HEAD"===f.type?A="nocontent":304===t?A="notmodified":(A=b.state,p=b.data,d=!(h=b.error))):(h=A,!t&&A||(A="error",t<0&&(t=0))),D.status=t,D.statusText=(n||A)+"",d?g.resolveWith(m,[p,A,D]):g.rejectWith(m,[D,A,h]),D.statusCode(E),E=void 0,c&&v.trigger(d?"ajaxSuccess":"ajaxError",[D,f,d?p:h]),y.fireWith(m,[D,A]),c&&(v.trigger("ajaxComplete",[D,f]),--S.active||S.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,t){S[t]=function(e,n,r,o){return m(n)&&(o=o||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:o,data:n,success:r},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},Ut=S.ajaxSettings.xhr();f.cors=!!Ut&&"withCredentials"in Ut,f.ajax=Ut=!!Ut,S.ajaxTransport(function(t){var n,r;if(f.cors||Ut&&!t.crossDomain)return{send:function(o,i){var a,l=t.xhr();if(l.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)l[a]=t.xhrFields[a];for(a in t.mimeType&&l.overrideMimeType&&l.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)l.setRequestHeader(a,o[a]);n=function(e){return function(){n&&(n=r=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===e?l.abort():"error"===e?"number"!=typeof l.status?i(0,"error"):i(l.status,l.statusText):i(Ht[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=n(),r=l.onerror=l.ontimeout=n("error"),void 0!==l.onabort?l.onabort=r:l.onreadystatechange=function(){4===l.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{l.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var zt,Wt=[],qt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Wt.pop()||S.expando+"_"+St.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(t,n,r){var o,i,a,l=!1!==t.jsonp&&(qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&qt.test(t.data)&&"data");if(l||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,l?t[l]=t[l].replace(qt,"$1"+o):!1!==t.jsonp&&(t.url+=(bt.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return a||S.error(o+" was not called"),a[0]},t.dataTypes[0]="json",i=e[o],e[o]=function(){a=arguments},r.always(function(){void 0===i?S(e).removeProp(o):e[o]=i,t[o]&&(t.jsonpCallback=n.jsonpCallback,Wt.push(o)),a&&m(i)&&i(a[0]),a=i=void 0}),"script"}),f.createHTMLDocument=((zt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===zt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(r)):t=h),i=!n&&[],(o=x.exec(e))?[t.createElement(o[1])]:(o=Ee([e],t,i),i&&i.length&&S(i).remove(),S.merge([],o.childNodes)));var r,o,i},S.fn.load=function(e,t,n){var r,o,i,a=this,l=e.indexOf(" ");return l>-1&&(r=ft(e.slice(l)),e=e.slice(0,l)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&S.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var r,o,i,a,l,s,u=S.css(e,"position"),c=S(e),d={};"static"===u&&(e.style.position="relative"),l=c.offset(),i=S.css(e,"top"),s=S.css(e,"left"),("absolute"===u||"fixed"===u)&&(i+s).indexOf("auto")>-1?(a=(r=c.position()).top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(s)||0),m(t)&&(t=t.call(e,n,S.extend({},l))),null!=t.top&&(d.top=t.top-l.top+a),null!=t.left&&(d.left=t.left-l.left+o),"using"in t?t.using.call(e,d):c.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?{top:(t=r.getBoundingClientRect()).top+(n=r.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],o={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((o=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),o.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-S.css(r,"marginTop",!0),left:t.left-o.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ne})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return U(this,function(e,r,o){var i;if(v(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===o)return i?i[t]:e[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):e[r]=o},e,r,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=Ue(f.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){S.fn[r]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),l=n||(!0===o||!0===i?"margin":"border");return U(this,function(t,n,o){var i;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===o?S.css(t,n,l):S.style(t,n,o,l)},t,a?o:void 0,a)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=o.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(o.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=T,S.isFunction=m,S.isWindow=v,S.camelCase=V,S.type=E,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Vt,"")};var Gt=e.jQuery,Kt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=Kt),t&&e.jQuery===S&&(e.jQuery=Gt),S},void 0===t&&(e.jQuery=e.$=S),S})});const B=e=>{let{className:t,onClick:n}=e;return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#1359C8",className:t,width:"24px",height:"24px",onClick:n},r.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))},F="__googleMapsScriptId";var j;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(j||(j={}));class H{constructor(e){let{apiKey:t,channel:n,client:r,id:o=F,libraries:i=[],language:a,region:l,version:s,mapIds:u,nonce:c,retries:d=3,url:p="https://maps.googleapis.com/maps/api/js"}=e;if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=s,this.apiKey=t,this.channel=n,this.client=r,this.id=o||F,this.libraries=i,this.language=a,this.region=l,this.mapIds=u,this.nonce=c,this.retries=d,this.url=p,H.instance){if(!function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}(this.options,H.instance.options))throw new Error("Loader must not be called again with different options. "+JSON.stringify(this.options)+" !== "+JSON.stringify(H.instance.options));return H.instance}H.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}get status(){return this.errors.length?j.FAILURE:this.done?j.SUCCESS:this.loading?j.LOADING:j.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),this.libraries.length>0&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="®ion="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(n=>{n?t(n.error):e(window.google)})})}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const e=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=e,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in "+e+" ms."),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}const U="undefined"!=typeof window&&window.google?window.google:null,z=e=>{let t={};const o=e=>{var t;let n=null;return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("postal_code");n=t?e.long_name:null}),n},i=[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],a=function(e,t,n){void 0===n&&(n=!1),(new U.maps.Geocoder).geocode({location:e},function(r,i){if("OK"===i&&r[0]){let i=o(r[0]);const a=document.getElementById("pac-input");a.value=(e=>{var t;let n="";return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("sublocality_level_2")||e.types.includes("sublocality_level_1");t&&(n=t?e.long_name:null)}),n})(r[0]),t&&(n?t(i,{longitude:e.lng,latitude:e.lat},a.value):t(i,{longitude:e.lng,latitude:e.lat}))}})},l=function(e,t,n){if(!e)return;const{latLng:r}=e,o={lat:r.lat(),lng:r.lng()};t("000000",{longitude:o.lng,latitude:o.lat})},s=function(e,n,r){void 0===r&&(r=!1);const s=new window.google.maps.Map(document.getElementById("map"),{center:n,zoom:15,mapTypeId:"roadmap",styles:i}),u=document.getElementById("pac-input");var c;u&&u.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}),(c=n).lat&&c.lng&&(t={north:c.lat+.1,south:c.lat-.1,east:c.lng+.1,west:c.lng-.1});const d=new window.google.maps.places.Autocomplete(u,{bounds:t,componentRestrictions:{country:"in"},fields:["address_components","geometry","icon","name"],origin:n,strictBounds:!1,types:["address"]});s.addListener("bounds_changed",()=>{d.setBounds(s.getBounds())});let p=[new window.google.maps.Marker({map:s,title:"a",position:n,draggable:!0,clickable:!0})];r?a(n,e,!0):a(n,e),p[0].addListener("dragend",t=>l(t,e)),d.addListener("place_changed",()=>{const t=d.getPlace();if(!t)return;let n=o(t);if(n){const{geometry:o}=t,i={latitude:o.location.lat(),longitude:o.location.lng()};r?e(n,i,t.name):e(n,i)}p.forEach(e=>{e.setMap(null)}),p=[];const i=new window.google.maps.LatLngBounds;t.geometry&&(p.push(new window.google.maps.Marker({map:s,title:t.name,position:t.geometry.location,draggable:!0,clickable:!0})),p[0].addListener("dragend",t=>l(t,e)),t.geometry.viewport?i.union(t.geometry.viewport):i.extend(t.geometry.location),s.fitBounds(i))})};return n.useEffect(()=>{!function(){try{const t=t=>{s(e.onChange,{lat:t.coords.latitude,lng:t.coords.longitude},e.isPlaceRequired)},n=t=>{let n={};var r;n=null!=e&&e.isPTDefault&&(null==e||null===(r=e.PTdefaultcoord)||void 0===r?void 0:r.defaultConfig)||{lat:31.6160638,lng:74.8978579},s(e.onChange,n,e.isPlaceRequired)};(e=>{var t;const n=null===(t=window.globalConfigs)||void 0===t?void 0:t.getConfig("GMAPS_API_KEY");new H({apiKey:n,version:"weekly",libraries:["places"]}).load().then(()=>{e&&e()}).catch(e=>{})})(()=>{var r,o,i;null!==(r=e.position)&&void 0!==r&&r.latitude&&null!==(o=e.position)&&void 0!==o&&o.longitude?t({coords:e.position}):null!==(i=navigator)&&void 0!==i&&i.geolocation?navigator.geolocation.getCurrentPosition(t,n):n()}),Promise.resolve()}catch(e){return Promise.reject(e)}}()},[]),r.createElement("div",{className:"map-wrap"},r.createElement("div",{className:"map-search-bar-wrap"},r.createElement(B,{className:"map-search-bar-icon"}),r.createElement("input",{id:"pac-input",className:"map-search-bar",type:"text",placeholder:"Search Address",style:{backgroundPosition:"left",color:"#222",caretColor:"#222"},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}})),r.createElement("div",{id:"map",className:"map"}))};var W="function"==typeof Symbol&&Symbol.for,q=W?Symbol.for("react.element"):60103,V=W?Symbol.for("react.portal"):60106,G=W?Symbol.for("react.fragment"):60107,K=W?Symbol.for("react.strict_mode"):60108,Y=W?Symbol.for("react.profiler"):60114,$=W?Symbol.for("react.provider"):60109,X=W?Symbol.for("react.context"):60110,Z=W?Symbol.for("react.async_mode"):60111,J=W?Symbol.for("react.concurrent_mode"):60111,Q=W?Symbol.for("react.forward_ref"):60112,ee=W?Symbol.for("react.suspense"):60113,te=W?Symbol.for("react.suspense_list"):60120,ne=W?Symbol.for("react.memo"):60115,re=W?Symbol.for("react.lazy"):60116,oe=W?Symbol.for("react.block"):60121,ie=W?Symbol.for("react.fundamental"):60117,ae=W?Symbol.for("react.responder"):60118,le=W?Symbol.for("react.scope"):60119;function se(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case q:switch(e=e.type){case Z:case J:case G:case Y:case K:case ee:return e;default:switch(e=e&&e.$$typeof){case X:case Q:case re:case ne:case $:return e;default:return t}}case V:return t}}}function ue(e){return se(e)===J}var ce={AsyncMode:Z,ConcurrentMode:J,ContextConsumer:X,ContextProvider:$,Element:q,ForwardRef:Q,Fragment:G,Lazy:re,Memo:ne,Portal:V,Profiler:Y,StrictMode:K,Suspense:ee,isAsyncMode:function(e){return ue(e)||se(e)===Z},isConcurrentMode:ue,isContextConsumer:function(e){return se(e)===X},isContextProvider:function(e){return se(e)===$},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===q},isForwardRef:function(e){return se(e)===Q},isFragment:function(e){return se(e)===G},isLazy:function(e){return se(e)===re},isMemo:function(e){return se(e)===ne},isPortal:function(e){return se(e)===V},isProfiler:function(e){return se(e)===Y},isStrictMode:function(e){return se(e)===K},isSuspense:function(e){return se(e)===ee},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===G||e===J||e===Y||e===K||e===ee||e===te||"object"==typeof e&&null!==e&&(e.$$typeof===re||e.$$typeof===ne||e.$$typeof===$||e.$$typeof===X||e.$$typeof===Q||e.$$typeof===ie||e.$$typeof===ae||e.$$typeof===le||e.$$typeof===oe)},typeOf:se},de=I(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case u:case c:case o:case a:case i:case p:return f;default:var h=f&&f.$$typeof;switch(h){case s:case d:case v:case m:case l:return h;default:return t}}case r:return t}}}var b=c,_=s,A=l,D=n,C=d,T=o,x=v,N=m,w=r,I=a,L=i,k=p,O=!1;function R(e){return S(e)===c}t.AsyncMode=u,t.ConcurrentMode=b,t.ContextConsumer=_,t.ContextProvider=A,t.Element=D,t.ForwardRef=C,t.Fragment=T,t.Lazy=x,t.Memo=N,t.Portal=w,t.Profiler=I,t.StrictMode=L,t.Suspense=k,t.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||S(e)===u},t.isConcurrentMode=R,t.isContextConsumer=function(e){return S(e)===s},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return S(e)===d},t.isFragment=function(e){return S(e)===o},t.isLazy=function(e){return S(e)===v},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===r},t.isProfiler=function(e){return S(e)===a},t.isStrictMode=function(e){return S(e)===i},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===c||e===a||e===i||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===s||e.$$typeof===d||e.$$typeof===g||e.$$typeof===y||e.$$typeof===E||e.$$typeof===h)},t.typeOf=S}()}),pe=I(function(e){e.exports="production"===process.env.NODE_ENV?ce:de}),fe=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;function he(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ge=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=he(e),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))me.call(n,a)&&(o[a]=n[a]);if(fe){r=fe(n);for(var l=0;l<r.length;l++)ve.call(n,r[l])&&(o[r[l]]=n[r[l]])}}return o},ye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Ee=Function.call.bind(Object.prototype.hasOwnProperty),Se=function(){};if("production"!==process.env.NODE_ENV){var be=ye,_e={},Ae=Ee;Se=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function De(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(Ae(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,r,n,null,be)}catch(e){a=e}if(!a||a instanceof Error||Se((r||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in _e)){_e[a.message]=!0;var s=o?o():"";Se("Failed "+n+" type: "+a.message+(null!=s?s:""))}}}De.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(_e={})};var Ce=De,Te=function(){};function xe(){return null}function Ne(){}function we(){}"production"!==process.env.NODE_ENV&&(Te=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),we.resetWarningCache=Ne;var Ie=I(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(xe),arrayOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new i("Invalid "+o+" `"+a+"` of type `"+c(l)+"` supplied to `"+r+"`, expected an array.");for(var s=0;s<l.length;s++){var u=e(l,s,r,o,a+"["+s+"]",ye);if(u instanceof Error)return u}return null})},element:a(function(t,n,r,o,a){var l=t[n];return e(l)?null:new i("Invalid "+o+" `"+a+"` of type `"+c(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,o){var a=e[t];return pe.isValidElementType(a)?null:new i("Invalid "+r+" `"+o+"` of type `"+c(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,o,a){var l;return t[n]instanceof e?null:new i("Invalid "+o+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,o){return u(e[t])?null:new i("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],s=c(l);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(Ee(l,u)){var d=e(l,u,r,o,a+"."+u,ye);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Te(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),xe;function t(t,n,r,a,l){for(var s=t[n],u=0;u<e.length;u++)if(o(s,e[u]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+c+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Te("Invalid argument supplied to oneOfType, expected an instance of array."),xe;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return Te("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),xe}return a(function(t,n,r,o,a){for(var l=[],s=0;s<e.length;s++){var u=(0,e[s])(t,n,r,o,a,ye);if(null==u)return null;u.data&&Ee(u.data,"expectedType")&&l.push(u.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,o,a){var l=t[n],u=c(l);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var p in e){var f=e[p];if("function"!=typeof f)return s(r,o,a,p,d(f));var m=f(l,p,r,o,a+"."+p,ye);if(m)return m}return null})},exact:function(e){return a(function(t,n,r,o,a){var l=t[n],u=c(l);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var p=ge({},t[n],e);for(var f in p){var m=e[f];if(Ee(e,f)&&"function"!=typeof m)return s(r,o,a,f,d(m));if(!m)return new i("Invalid "+o+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=m(l,f,r,o,a+"."+f,ye);if(v)return v}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,o,a,l,s){if(o=o||"<<anonymous>>",l=l||r,s!==ye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}return null==n[r]?t?new i(null===n[r]?"The "+a+" `"+l+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+a+" `"+l+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,r,o,a,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,n,r,o,a,l){var s=t[n];return c(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+d(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,r,o){return new i((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function u(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(u);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!u(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!u(a[1]))return!1}return!0;default:return!1}}function c(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=c(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,r.checkPropTypes=Ce,r.resetWarningCache=Ce.resetWarningCache,r.PropTypes=r,r}(pe.isElement):function(){function e(e,t,n,r,o,i){if(i!==ye){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:we,resetWarningCache:Ne};return n.PropTypes=n,n}()});const Le=["onClick","style","children","className","ReactRef"],ke=e=>{var t;let{onClick:n,style:o,children:a,className:l,ReactRef:s}=e,u=d(e,Le);const{pathname:p}=i.useLocation(),f=Digit.Hooks.fsm.useRouteSubscription(p),m=null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info;return r.createElement("div",c({className:("employee"===f||"EMPLOYEE"===(null==m?void 0:m.type)?"employeeCard":"card")+" "+(l||""),onClick:n,style:o},u,{ref:s}),a)},Oe=e=>r.createElement("div",{className:"card-header",style:e.styles?c({},e.styles,{marginBottom:"30px"}):{marginBottom:"30px"}},e.children,e.divider&&r.createElement("hr",{style:{border:"1px solid #DFE0E2",marginTop:"10px"}}));Oe.propTypes={styles:Ie.object,divider:Ie.bool,children:Ie.node.isRequired},Oe.defaultProps={styles:{},divider:!1};const Re=e=>r.createElement("p",{className:"card-text "+(e.disable&&"disabled")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),Pe=e=>r.createElement("h2",{className:"card-label-error "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),Me=e=>{let{header:t,cardText:o,nextText:i,t:a,forcedError:l,onSave:s,onChange:u,position:c,onSelect:d,disabled:p,cardBodyStyle:f={},isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:h,handleRemove:g,Webview:y=!1,isPopUp:E=!1}=e;const S=n.useRef(!0);n.useEffect(()=>()=>{S.current=!1},[]);const[b,_]=n.useState(Boolean(p||!1));n.useEffect(()=>{S.current&&_(Boolean(p||!1))},[p]);const[A,D]=n.useState({latitude:0,longitude:0}),[C,T]=n.useState(),[x,N]=n.useState(),w=e=>{S.current&&T(e)},I=e=>{S.current&&D(e)};return r.createElement(ke,{style:{position:"relative"}},r.createElement("div",{style:{display:"flex"}},r.createElement("svg",{style:{marginTop:y?"16px":"8px"},width:"24",height:"24",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M14.9999 9.66666C12.0533 9.66666 9.66658 12.0533 9.66658 15C9.66658 17.9467 12.0533 20.3333 14.9999 20.3333C17.9466 20.3333 20.3333 17.9467 20.3333 15C20.3333 12.0533 17.9466 9.66666 14.9999 9.66666ZM26.9199 13.6667C26.3066 8.10666 21.8933 3.69333 16.3333 3.07999V0.333328H13.6666V3.07999C8.10658 3.69333 3.69325 8.10666 3.07992 13.6667H0.333252V16.3333H3.07992C3.69325 21.8933 8.10658 26.3067 13.6666 26.92V29.6667H16.3333V26.92C21.8933 26.3067 26.3066 21.8933 26.9199 16.3333H29.6666V13.6667H26.9199ZM14.9999 24.3333C9.83992 24.3333 5.66658 20.16 5.66658 15C5.66658 9.83999 9.83992 5.66666 14.9999 5.66666C20.1599 5.66666 24.3333 9.83999 24.3333 15C24.3333 20.16 20.1599 24.3333 14.9999 24.3333Z",fill:"#505A5F"})),r.createElement(Oe,null,t)),r.createElement("div",{style:f},E&&r.createElement("button",{type:"button",onClick:()=>g&&g(),style:{position:"absolute",left:12,top:12,padding:"8px 10px",background:"#fff",color:"#0b74de",border:"none",borderRadius:6,cursor:"pointer",fontWeight:700,fontSize:13,lineHeight:"16px",zIndex:9999,appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"},"aria-label":"Close",title:"Close"},r.createElement("span",{style:{color:"red",display:"inline-block"}},"Close")),r.createElement(Re,null,o),r.createElement(z,{onChange:h?(e,t,n)=>{w(e),I(t),(e=>{S.current&&N(e)})(n),S.current&&_(!e)}:(e,t)=>{w(e),I(t),S.current&&_(!e)},position:c,isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:h}),l&&r.createElement(Pe,null,a(l))),r.createElement("div",{style:{padding:"12px"}},(()=>{const e=null!=i?i:a?a("ADS_PIN_LOCATION_LABEL"):null,t="string"==typeof e&&e.trim()?e:a&&a("ADS_PIN_LOCATION_LABEL")||"Pick";return r.createElement("button",{type:"button",onClick:e=>{e&&e.preventDefault(),e&&e.stopPropagation(),(()=>{const e={geoLocation:A};if("function"!=typeof d)if("function"!=typeof s)"function"!=typeof u?console.warn("LocationSearchCard: no submit callback provided by parent."):x&&Object.keys(x).length?u(C,A,x):u(C,A);else try{s(A,C,x)}catch(t){try{s(e)}catch(e){console.warn("LocationSearchCard: onSave call failed",e)}}else d("address",e)})()},disabled:b,"aria-disabled":b,style:{display:"inline-block",width:"100%",padding:"10px 12px",background:b?"#ddd":"#0b74de",color:b?"#666":"#fff",border:"none",borderRadius:6,cursor:b?"not-allowed":"pointer",textAlign:"center",fontWeight:700,fontSize:14,lineHeight:"20px",WebkitTextFillColor:b?"#666":"#fff",appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"}},t||"Pick"," ")})()))};Me.propTypes={header:Ie.string,cardText:Ie.string,nextText:Ie.string,t:Ie.func,skipAndContinueText:Ie.string,skip:Ie.func,onSave:Ie.func,onChange:Ie.func,position:Ie.any,onSelect:Ie.func,isPTDefault:Ie.any,PTdefaultcoord:Ie.any,isPlaceRequired:Ie.any,handleRemove:Ie.func,Webview:Ie.bool,isPopUp:Ie.bool},Me.defaultProps={header:"",cardText:"",nextText:"",skipAndContinueText:"",onSelect:null,skip:()=>{},onSave:null,onChange:()=>{},position:void 0,isPTDefault:!1,PTdefaultcoord:{},isPlaceRequired:!1,handleRemove:()=>{},Webview:!1,isPopUp:!1};const Be=e=>{let{t:n,currentPage:o,columns:i,data:a,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:f,pageSizeLimit:m,sortParams:v,totalRecords:h}=e;return r.createElement(t.Table,{t:n,data:a,currentPage:o,columns:i,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:m,disableSort:s,isPaginationRequired:f,onPageSizeChange:p,onSort:u,sortParams:v,totalRecords:h})},Fe=e=>{let{onSubmit:i,setExistingDataSet:a,Searchdata:l}=e;const{t:s}=o.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[d,p]=n.useState(null),[f,m]=n.useState(!1),v=Digit.UserService.getUser().info,h=Digit.Hooks.ads.useADSSlotSearch(),g={advertisementSlotSearchCriteria:l.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:u,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};n.useEffect(()=>{f&&(i(),m(!1))},[f,i]);let y,E=window.location.href.split("/").pop();isNaN(parseInt(E))||(y=E);let S=isNaN(parseInt(E))?{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:u,mobileNumber:null==v?void 0:v.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:y,tenantId:u};n.useEffect(()=>{p(S)},[E]);const{isLoading:b,data:_}=Digit.Hooks.ads.useADSSearch({filters:d});if(b)return r.createElement(t.Loader,null);const A=(null==_?void 0:_.bookingApplication)||[],D={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},C={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("div",null,A.length>0&&A.map((e,n)=>{var o;return r.createElement("div",{key:n},r.createElement(t.Card,{style:c({},D,{cursor:"pointer"}),onMouseEnter:e=>{e.currentTarget.style.backgroundColor=C.backgroundColor,e.currentTarget.style.boxShadow=C.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{!function(e){try{Promise.resolve(h.mutateAsync(g)).then(function(t){var n,r,o,i,l,s,u,c,d,p,f;const v=null==t?void 0:t.advertisementSlotAvailabiltityDetails[0].timerValue,h={documents:{documents:null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>({documentDetailId:null==e?void 0:e.documentDetailId,documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.fileStoreId}))},address:{pincode:null==e||null===(r=e.address)||void 0===r?void 0:r.pincode,houseNo:null==e||null===(o=e.address)||void 0===o?void 0:o.houseNo,streetName:null==e||null===(i=e.address)||void 0===i?void 0:i.streetName,landmark:null==e||null===(l=e.address)||void 0===l?void 0:l.landmark,addressline1:null==e||null===(s=e.address)||void 0===s?void 0:s.addressLine1,addressline2:null==e||null===(u=e.address)||void 0===u?void 0:u.addressLine2},applicant:{applicantName:null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.applicantName,mobileNumber:null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.applicantMobileNo,alternateNumber:null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.applicantAlternateMobileNo,emailId:null==e||null===(f=e.applicantDetail)||void 0===f?void 0:f.applicantEmailId},timervalue:{timervalue:v||0},draftId:(null==t?void 0:t.draftId)||""};a(h),m(!0)})}catch(e){return Promise.reject(e)}}(e)}},r.createElement(t.KeyNote,{keyValue:s("ADS_BOOKING_NO"),note:null==e?void 0:e.bookingNo}),r.createElement(t.KeyNote,{keyValue:s("ADS_APPLICANT_NAME"),note:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantName}),r.createElement(t.KeyNote,{keyValue:s("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:s(""+(null==e?void 0:e.bookingStatus))})))}),0===A.length&&!b&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},s("ADS_NO_APPLICATION_FOUND_MSG"))))},je=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),He=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(je,null)),Ue=e=>{let{t:o,closeModal:i,onSubmit:a,setExistingDataSet:l,Searchdata:s}=e;const[u,c]=n.useState(!1),[d,p]=n.useState(!1),f=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),m=e=>u&&r.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),v=Digit.Hooks.ads.useADSSlotSearch(),h={advertisementSlotSearchCriteria:s.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:f,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{d&&(a(),p(!1))},[d,a]),r.createElement(r.Fragment,null,r.createElement(t.Modal,{headerBarMain:r.createElement(m,{t:o}),headerBarEnd:r.createElement(He,{onClick:i}),actionCancelLabel:u&&o("CS_COMMON_BACK"),actionCancelOnSubmit:()=>c(!1),hideSubmit:!0,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},u&&r.createElement(Fe,{onSubmit:a,setExistingDataSet:l,Searchdata:s}),r.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&r.createElement(t.SubmitBar,{label:o("USE_EXISTING_DETAILS"),onSubmit:()=>{c(!0)}}),!u&&r.createElement(t.SubmitBar,{label:o("FILL_NEW_DETAILS"),onSubmit:function(){try{return Promise.resolve(v.mutateAsync(h)).then(function(e){l({timervalue:{timervalue:(null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue)||10},draftId:(null==e?void 0:e.draftId)||""}),p(!0)})}catch(e){return Promise.reject(e)}}})))))},ze=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),We=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(ze,null)),qe=e=>{let{onClose:n,cartDetails:a,setCartDetails:l}=e;const{t:s}=o.useTranslation(),u=(i.useLocation(),[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},s("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:s("ADD_TYPE"),accessor:"addType"},{Header:s("FACE_AREA"),accessor:"faceArea"},{Header:s("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,s(t?"Yes":"No"))}},{Header:s("BOOKING_DATE"),accessor:"bookingDate"},{Header:s("UNIT_PRICE"),accessor:"price"},{Header:s("ADS_STATUS"),accessor:"status",Cell:e=>{let{value:t}=e;return r.createElement("div",{className:"sla-cell-success"},t)}},{Header:s("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{const t=a.filter((t,n)=>n!==e);l(t)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}]);return r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(We,{onClick:n}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Be,{t:s,data:a,columns:u,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:a.length}),r.createElement("div",{style:{position:"sticky",bottom:0,backgroundColor:"#fff",padding:"15px 20px",fontSize:"18px",fontWeight:"bold",boxShadow:"0 -2px 5px rgba(0,0,0,0.1)",zIndex:10}},"Total Price: ",a.reduce((e,t)=>e+Number(t.price),0)))},Ve=e=>{let{styles:t,className:n}=e;return r.createElement("svg",{width:"24",height:"24",className:n,style:c({},t),viewBox:"0 0 24 24",fill:"#ffffff",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M7 10H4V17H7V10Z"}),r.createElement("path",{d:"M13.5 10H10.5V17H13.5V10Z"}),r.createElement("path",{d:"M22 19H2V22H22V19Z"}),r.createElement("path",{d:"M20 10H17V17H20V10Z"}),r.createElement("path",{d:"M12 1L2 6V8H22V6L12 1Z"}))},Ge=e=>{let{headComment:t,otherComment:n}=e;return r.createElement("div",{className:"checkpoint-comments-wrap"},r.createElement("h4",null,t),r.createElement("p",null,n))},Ke=e=>{var n,i,a;let{data:l,OpenImage:s}=e;const{t:u}=o.useTranslation();return r.createElement("div",null,l.date&&r.createElement("p",null,l.date),r.createElement("p",null,l.name),l.mobileNumber&&r.createElement(t.TelePhone,{mobile:l.mobileNumber}),l.source&&r.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+l.source.toUpperCase())),l.comment&&r.createElement(Ge,{otherComment:null==l?void 0:l.otherComment,headComment:null==l?void 0:l.comment}),null!=l&&l.wfComment?r.createElement("div",null,null==l||null===(n=l.wfComment)||void 0===n?void 0:n.map(e=>r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("WF_COMMON_COMMENTS")),r.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==l||null===(i=l.thumbnailsToShow)||void 0===i||null===(a=i.thumbs)||void 0===a?void 0:a.length)>0?r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),r.createElement(t.DisplayPhotos,{srcs:null==l?void 0:l.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==l?void 0:l.thumbnailsToShow)}})):null)};"undefined"!=typeof window&&void 0===window.process&&(window.process={env:{}});const Ye=e=>{var o,i;let{t:a,onSelect:l,formData:s={},handleRemove:u,onSave:c}=e;const[d,p]=n.useState((null==s||null===(o=s.address)||void 0===o?void 0:o.pincode)||""),[f,m]=n.useState((null==s||null===(i=s.address)||void 0===i?void 0:i.geoLocation)||{}),v=Digit.Hooks.obps.useTenants(),[h,g]=n.useState(null),[y,E]=n.useState("");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let S=!Digit.Utils.browser.isMobile();return r.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0",zIndex:9999},onClick:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onMouseDown:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onKeyDown:e=>{!e||"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation())}},r.createElement("div",{style:{position:"relative",marginTop:"60px"}},r.createElement("div",{style:S?{marginLeft:"25%",marginRight:"25%"}:{}},r.createElement(t.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:a?a("ADS_GIS_LABEL"):"Pick location",nextText:a&&a("ADS_PIN_LOCATION_LABEL")||"Pick location",skip:()=>{if("function"==typeof l)try{return l()}catch(e){return void console.warn("GIS: onSelect threw",e)}if("function"==typeof c)try{return c(f||{},d||"",y||"")}catch(e){try{return c({geoLocation:f||{},pincode:d||"",placeName:y||""})}catch(e){console.warn("GIS: onSave also failed",e)}}console.warn("GIS: neither onSelect nor onSave provided for skip")},t:a,position:f,onSave:()=>{if("function"==typeof c)try{c(f,d,y)}catch(e){try{c({geoLocation:f,pincode:d,placeName:y})}catch(e){console.warn("GIS: onSave call failed",e)}}else console.warn("GIS: onSave not provided")},onChange:(e,t,n)=>{((e,t,n)=>{g(null),(null==v?void 0:v.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==e)}))?(p(e),m(t),E(n)):(g("BPA_COMMON_PINCODE_NOT_SERVICABLE"),p(""),m({}),E(""))})(e,t,n)},disabled:!1,forcedError:h?a(h):null,isPlaceRequired:!0,handleRemove:u,Webview:S,isPopUp:!0}))))},$e=e=>{var n,i,a,l,s,u,c,d;const{t:p}=o.useTranslation(),f=null==e||null===(n=e.application)||void 0===n||null===(i=n.workflow)||void 0===i?void 0:i.businessService,{isLoading:m,data:v}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id||(null===(l=e.application)||void 0===l?void 0:l.applicationNumber)||(null===(s=e.application)||void 0===s?void 0:s.bookingNo),moduleCode:"advandhoarding-services"});function h(e,t,n){var r;window.open(null==n||null===(r=n.fullImage)||void 0===r?void 0:r[0],"_blank")}const g=t=>{if("OPEN"===t.state){var n,o;const i={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(o=e.application)||void 0===o?void 0:o.channel)||""};return r.createElement(Ke,{data:i})}if(t.state){var i,a,l,s,u;const e={date:null==t||null===(i=t.auditDetails)||void 0===i?void 0:i.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.name,mobileNumber:null==t||null===(s=t.assignes)||void 0===s||null===(u=s[0])||void 0===u?void 0:u.mobileNumber,comment:p(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return r.createElement(Ke,{data:e,OpenImage:h})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:p(null==t?void 0:t.comment)};return r.createElement(Ke,{data:n})}};return m?r.createElement(t.Loader,null):r.createElement(r.Fragment,null,(null==v||null===(u=v.timeline)||void 0===u?void 0:u.length)>0&&r.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=v&&v.timeline&&1===(null==v||null===(c=v.timeline)||void 0===c?void 0:c.length)?r.createElement(t.CheckPoint,{isCompleted:!0,label:p((null==v||null===(d=v.timeline[0])||void 0===d?void 0:d.state)&&"WF_"+f+"_"+v.timeline[0].state||"NA"),customChild:g(null==v?void 0:v.timeline[0])}):r.createElement(t.ConnectingCheckPoints,null,(null==v?void 0:v.timeline)&&(null==v?void 0:v.timeline.map((e,n)=>{var o;let i="";if(window.location.href.includes("/obps/")){var a,l;const t=null==v||null===(a=v.timeline)||void 0===a||null===(l=a[n-1])||void 0===l?void 0:l.state;i=t&&(t.includes("BACK_FROM")||t.includes("SEND_TO_CITIZEN"))?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===n?"":"_DONE"}return r.createElement(r.Fragment,{key:n},r.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:p("ES_ADS_COMMON_STATUS_"+(null==v||null===(o=v.processInstances[n].state)||void 0===o?void 0:o.state)+i),customChild:g(e)}))}))))};let Xe=[];const Ze=e=>{let{currentStep:n=1,flow:i=""}=e;const{t:a}=o.useTranslation(),l=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":Xe=[];break;default:Xe=["ADS_APPLICANT_DETAILS","ADS_ADDRESS_DETAILS","ADS_UPLOAD_DOCUMENTS","ADS_SUMMARY"]}})(i),r.createElement("div",{className:"timeline-container",style:l?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},Xe.map((e,o,i)=>r.createElement("div",{className:"timeline-checkpoint",key:o},r.createElement("div",{className:"timeline-content"},r.createElement("span",{className:"circle "+(o<=n-1&&"active")},o<n-1?r.createElement(t.TickMark,null):o+1),r.createElement("span",{className:"secondary-color"},a(e))),o<i.length-1&&r.createElement("span",{className:"line "+(o<n-1&&"active")}))))},Je=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Qe=e=>{let{onClick:t}=e;return r.createElement("div",{className:"icon-bg-secondary",onClick:t},r.createElement(Je,null))},et=()=>{var e,i,a,l,s,u,d,p,f,m,v,h,g,y,E;const[S,b]=n.useState(!1),[_,A]=n.useState(!1),{t:D}=o.useTranslation(),[C,T]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),x=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[N,w]=n.useState(!1),[I,L]=n.useState(!1),k=[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},D("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:D("ADD_TYPE"),accessor:"addType"},{Header:D("FACE_AREA"),accessor:"faceArea"},{Header:D("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,D(t?"Yes":"No"))}},{Header:D("BOOKING_DATE"),accessor:"bookingDate"},{Header:D("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{var t;const n=c({},C);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),T(n)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}];let O={tenantId:x,cartDetails:null==C||null===(e=C.adslist)||void 0===e?void 0:e.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}))},R=Digit.Hooks.ads.useADSDemandEstimation();!1===N&&(R.mutate(O),w(!0));const P=()=>{A(e=>!e)},M=()=>{L(!I)},B=()=>{b(e=>!e)},F=(null===(i=R.data)||void 0===i?void 0:i.demands[0])&&(null===(a=R.data)||void 0===a||null===(l=a.demands[0])||void 0===l?void 0:l.additionalDetails);return r.createElement("div",null,r.createElement(t.CardSubHeader,{style:{color:"#a82227"}},"Cart Details"),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement("div",null,r.createElement("div",{onClick:P,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},r.createElement("div",{class:"container",style:{width:"1px"}}," ",r.createElement("div",{style:{width:"20px",position:"relative"}},r.createElement("div",{style:{position:"absolute",top:"-4px",right:"-93px",color:"#008000",padding:"5px",borderRadius:"30px",width:"30px",height:"30px",textAlign:"center"}},r.createElement("div",null," ",null==C||null===(s=C.adslist)||void 0===s?void 0:s.cartDetails.length)))),"View Cart"),r.createElement("div",{onClick:B,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},"Terms and Conditions")),r.createElement("div",{onClick:M,style:{cursor:"pointer",fontSize:"20px",color:"#a82227"}},"Total Booking Amount: ",r.createElement("strong",null,F," INR"))),S&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Terms and Conditions"),headerBarEnd:r.createElement(Qe,{onClick:B}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"80%",overflowY:"auto"},actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},popupModuleMianStyles:{padding:"10px"},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:S,onClose:B}),_&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(Qe,{onClick:P}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Be,{t:D,data:null==C||null===(u=C.adslist)||void 0===u?void 0:u.cartDetails,columns:k,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:null==C||null===(d=C.adslist)||void 0===d?void 0:d.cartDetails.length})),I&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:r.createElement(Qe,{onClick:M}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"60%",overflowY:"auto"},children:r.createElement("div",null,r.createElement(t.CardLabelDesc,{style:{marginBottom:"15px"}},"Estimate Price Details"),r.createElement("ul",null,(null===(p=R.data)||void 0===p||null===(f=p.demands[0])||void 0===f?void 0:f.demandDetails)&&(null===(m=R.data)||void 0===m||null===(v=m.demands[0])||void 0===v?void 0:v.demandDetails.map((e,n)=>r.createElement("li",{key:n,style:{display:"flex",justifyContent:"space-between"}},r.createElement(t.CardText,null,D(""+e.taxHeadMasterCode)),r.createElement(t.CardText,null,"Rs ",e.taxAmount))))),r.createElement("hr",null),r.createElement("div",{style:{fontWeight:"bold",marginTop:"10px",display:"flex",justifyContent:"space-between"}},r.createElement(t.CardLabelDesc,null,"Total"),r.createElement(t.CardLabelDesc,null,"Rs ",(null===(h=R.data)||void 0===h||null===(g=h.demands[0])||void 0===g?void 0:g.demandDetails)&&(j=null===(y=R.data)||void 0===y||null===(E=y.demands[0])||void 0===E?void 0:E.demandDetails,j.reduce((e,t)=>e+t.taxAmount,0))))),actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:I,onClose:M}));var j};function tt(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const nt=e=>{let{t:o,SlotSearchData:i,draftId:a=""}=e;const[l,s]=n.useState(0),[u,c]=n.useState(null),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState(!1),m=Digit.Hooks.ads.useADSSlotSearch(),v={advertisementSlotSearchCriteria:i.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:d,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,draftId:a,isTimerRequired:!0}))};return n.useEffect(()=>{0!==l||p||(function(){try{const e=tt(function(){return Promise.resolve(m.mutateAsync(v)).then(function(e){var t;const n=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),r=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;n?c({error:!0,label:o("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):s(r||0)})},function(){c({error:!0,label:o("CS_SOMETHING_WENT_WRONG")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),f(!0))},[o,l,p]),n.useEffect(()=>{if(l>0){const e=setInterval(()=>{s(t=>t<=0?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)}},[l]),n.useEffect(()=>{if(u){const e=setTimeout(()=>{c(null)},2e3);return()=>clearTimeout(e)}},[u]),r.createElement("div",null,r.createElement("span",{className:"astericColor"},(e=>{const t=e%60;return Math.floor(e/60)+":"+(t<10?"0":"")+t})(l)),u&&r.createElement(t.Toast,{error:u.error,warning:u.warning,label:o(u.label),onClose:()=>{c(null)}}))};function rt(e){var o;let{t:i,document:a,setDocuments:l,setError:s,documents:u,action:d,formData:p,id:f}=e;const m=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],v=Digit.UserService.getUser().info,[h,g]=(Digit.ULBService.getCurrentTenantId(),n.useState(m?c({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:"ADS_"+(null==m?void 0:m.documentType.replaceAll(".","_"))}):(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)>0?null==a?void 0:a.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[_,A]=n.useState(!1),{dropdownData:D}=a;var C=D;const[T,x]=n.useState(!1),N=()=>r.createElement("div",{className:"loading-spinner"});return n.useEffect(()=>{null!=h&&h.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==S?void 0:S.length)||null===S?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==h?void 0:h.code,fileStoreId:S,documentUid:S}]})},[S,h]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],r=C.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(g(r),b(null==n?void 0:n.fileStoreId)):x(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=tt(function(){return b(null),A(!0),Promise.resolve(Digit.UploadServices.Filestorage("ADS",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){s(i("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(A(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{T&&b(null)},[T]),r.createElement("div",{style:{marginBottom:"24px"}},null!=a&&a.hasDropdown?r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i("ADS_"+(null==a?void 0:a.code.replaceAll(".","_")))," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.Dropdown,{className:"form-field",selected:h,style:{width:"EMPLOYEE"===v.type?"50%":"100%"},placeholder:"Select "+i("ADS_"+(null==a?void 0:a.code.replaceAll(".","_"))),option:C.map(e=>{var t;return c({},e,{i18nKey:"ADS_"+(null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_"))})}),select:e=>g(e),optionKey:"i18nKey",t:i})):null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){E(e.target.files[0])},onDelete:()=>{b(null)},id:f,message:_?r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(N,null),r.createElement("span",null,"Uploading...")):S?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function ot(e){let{value:n={},Code:i,index:a,showFileName:l=!1}=e;o.useTranslation();const{isLoading:s,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},i,a),d=e=>{let{width:t=20,height:n=20,style:o}=e;return r.createElement("svg",{style:o,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},r.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))},p=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===i).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===i).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")}));return s?r.createElement(t.Loader,null):r.createElement("div",null,r.createElement(r.Fragment,null,r.createElement("div",null,p.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let r=e[t]||"",o=(null==r?void 0:r.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i}(u.pdfFiles,e.fileStoreId);return r.createElement("a",{target:"_",href:n,style:{minWidth:"160px"},key:t},r.createElement(d,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}))}))))}const it=e=>{let{jumpTo:n}=e;const{t:a}=o.useTranslation(),l=i.useHistory();return r.createElement(t.LinkButton,{label:a("CS_COMMON_EDIT"),className:"check-page-link-button",onClick:function(){l.push(n)}})},at=()=>{const{t:e}=o.useTranslation(),{data:i,isFetching:a,isSuccess:l}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"ADS",filters:{limit:10,offset:0,services:["ads"]},config:{select:e=>({tSotalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.ptAccess()}});n.useEffect(()=>{!a&&l&&u(i)},[a]);const[s,u]=n.useState("-");if(!Digit.Utils.adsAccess())return null;const c=[{label:e("ADS_BOOK"),link:"/digit-ui/employee/ads/bookad/searchads"},{label:e("ADS_SEARCH_BOOKINGS"),link:"/digit-ui/employee/ads/my-applications"}],d=Digit.UserService.hasAccess(["ADS_CEMP"])||!1,p={Icon:r.createElement(Ve,null),moduleName:e("ADS_ADVERTISEMENT_MODULE"),links:c.filter(e=>!(null!=e&&e.role)||d)};return r.createElement(t.EmployeeModuleCard,p)},lt=e=>{var o,i;let{value:a,onChange:l,onBlur:s,t:u}=e;const[c,d]=n.useState(!1),[p,f]=n.useState(""),m="undefined"!=typeof window&&(null===(o=window.location)||void 0===o||null===(i=o.href)||void 0===i?void 0:i.includes("citizen"));return n.useEffect(()=>{f(a?"string"==typeof a?a:a.formattedAddress||(a.latitude&&a.longitude?a.latitude+", "+a.longitude:""):"")},[a]),r.createElement(n.Fragment,null,r.createElement("div",{style:{width:"100%",marginTop:"8px"}},r.createElement(t.TextInput,{value:p,onChange:()=>{},onBlur:s,disabled:!0,placeholder:u("ADS_LOCATION"),style:{maxWidth:!m&&"330px"}})),c&&r.createElement(Ye,{t:u,formData:{address:{pincode:(null==a?void 0:a.pincode)||"",geoLocation:a||{}}},handleRemove:()=>d(!1),onSave:(e,t,n)=>((e,t,n)=>{const r=((e,t,n)=>{var r,o,i,a,l,s;return{formattedAddress:n||(null==e?void 0:e.formattedAddress)||(null==e?void 0:e.place_name)||"",latitude:null!=(r=null!=(o=null!=(i=null==e?void 0:e.latitude)?i:null==e?void 0:e.lat)?o:null==e?void 0:e.y)?r:null,longitude:null!=(a=null!=(l=null!=(s=null==e?void 0:e.longitude)?s:null==e?void 0:e.lng)?l:null==e?void 0:e.x)?a:null,placeId:(null==e?void 0:e.placeId)||(null==e?void 0:e.id)||null,raw:e||{},pincode:t||null}})(e,t,n);f(r.formattedAddress),l&&l(r),d(!1)})(e,t,n)}))},st=e=>{let{t:n,currentPage:o,columns:i,data:a,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:f,sortParams:m,totalRecords:v}=e;return r.createElement(t.Table,{t:n,data:a,currentPage:o,columns:i,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:f,disableSort:s,onPageSizeChange:p,onSort:u,sortParams:m,totalRecords:v})},ut=e=>{const{t:a}=o.useTranslation(),l=[{text:a("ES_TITLE_NEW_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad",roles:[]}],[s,u]=n.useState([]);return Digit.UserService.getUser(),n.useEffect(()=>{u(l)},[]),r.createElement(t.Card,{className:"employeeCard filter inboxLinks"},r.createElement("div",{className:"complaint-links-container"},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.PropertyHouse,null))," ",r.createElement("span",{className:"text"},a("ADS_SERVICE"))),r.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:o,hyperlink:l=!1,roles:s=[]}=e;return r.createElement("span",{className:"link",key:t},l?r.createElement("a",{href:n},o):r.createElement(i.Link,{to:n},a(o)))}))))},ct=["pattern","name","maxLength","minLength","errorMessages"],dt={date:t.DatePicker,mobileNumber:t.MobileNumber,Locality:e=>r.createElement(t.Localities,{tenantId:Digit.ULBService.getCurrentTenantId(),selectLocality:e.onChange,keepNull:!1,boundaryType:"revenue",selected:e.value,disableLoader:!0,sortFn:(e,t)=>e.i18nkey<t.i18nkey?-1:1})},pt=e=>{var i;let{onSearch:l,type:s,onClose:u,searchFields:p,searchParams:f,isInboxPage:m,clearSearch:v}=e;const{t:h}=o.useTranslation(),{handleSubmit:g,reset:y,watch:E,control:S,setError:b,clearErrors:_,formState:A,setValue:D}=a.useForm({defaultValues:m?f:c({locality:null,city:null},f)}),C=E(),T=innerWidth<=640;function x(){const e=p.reduce((e,t)=>c({},e,{[null==t?void 0:t.name]:""}),{});if(y(e),m){const e=c({},f);e.delete=[],p.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),l(c({},e))}else v()}n.useEffect(()=>{p.forEach(e=>{let{pattern:t,name:n,maxLength:r,minLength:o,errorMessages:i}=e;d(e,ct);const a=C[n],l=A.errors[n];t&&(new RegExp(t).test(a)||l?new RegExp(t).test(a)&&"pattern"===(null==l?void 0:l.type)&&_([n]):b(n,{type:"pattern",message:h(null==i?void 0:i.pattern)||h("PATTERN_"+n.toUpperCase()+"_FAILED")})),o&&((null==a?void 0:a.length)<o&&!l?b(n,{type:"minLength",message:h((null==i?void 0:i.minLength)||"MINLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==a?void 0:a.length)>=o&&"minLength"===(null==l?void 0:l.type)&&_([n])),r&&((null==a?void 0:a.length)>r&&!l?b(n,{type:"maxLength",message:h((null==i?void 0:i.maxLength)||"MAXLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==a?void 0:a.length)<=r&&"maxLength"===(null==l?void 0:l.type)&&_([n]))})},[C,A,b,_]);const N=e=>r.createElement(t.LinkLabel,{style:c({display:"inline"},e?{margin:0}:{}),onClick:x},h("ES_COMMON_CLEAR_SEARCH"));return r.createElement("form",{onSubmit:g(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],p.forEach(t=>{e[t.name]||e.delete.push(t.name)}),l(e),"mobile"===s&&u()})},r.createElement(r.Fragment,null,r.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:m?"24px":"revert"}},r.createElement("div",{className:"search-complaint-container"},("mobile"===s||T)&&r.createElement("div",{className:"complaint-header"},r.createElement("h2",null,h("ES_COMMON_SEARCH_BY")),r.createElement("span",{onClick:u},r.createElement(t.CloseSvg,null))),r.createElement("div",{className:"complaint-input-container for-pt "+(m?"":"for-search"),style:{width:"100%",display:"grid"}},null==p||null===(i=p.filter(e=>!0))||void 0===i?void 0:i.map((e,n)=>{var o,i,l;return r.createElement("div",{key:e.name,className:"input-fields"},r.createElement("span",{className:"mobile-input"},r.createElement(t.Label,null,h(e.label)+" "+(e.isMendatory?"*":"")),r.createElement(a.Controller,e.type?{render:t=>r.createElement(null==dt?void 0:dt[e.type],{formValue:C,setValue:D,onChange:t.onChange,value:t.value}),name:e.name,control:S,defaultValue:""}:{render:e=>r.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:S,defaultValue:""})),null!=A&&null!==(o=A.dirtyFields)&&void 0!==o&&o[e.name]?r.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==A||null===(i=A.errors)||void 0===i||null===(l=i[e.name])||void 0===l?void 0:l.message):null)}),m&&r.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},r.createElement("div",null,N())),"desktop"===s&&!T&&r.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},r.createElement(t.SubmitBar,{className:"submit-bar-search",label:h("ES_COMMON_SEARCH"),disabled:!!Object.keys(A.errors).length||(()=>{var e;let t=!0;return Object.keys(C).forEach(e=>{!["locality","city"].includes(e)&&C[e]&&(t=!1)}),null==p||!p.find(e=>"locality"===e.name)||null!=C&&null!==(e=C.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!m&&r.createElement("div",null,N()))))),("mobile"===s||T)&&r.createElement(t.ActionBar,{className:"clear-search-container"},r.createElement("button",{className:"clear-search",style:{flex:1}},N(T)),r.createElement(t.SubmitBar,{disabled:!!Object.keys(A.errors).length,label:h("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},ft=["tableConfig","filterComponent"],mt=e=>{let{tableConfig:i,filterComponent:a}=e,l=d(e,ft);const{data:s,useNewInboxAPI:u}=l,{t:c}=o.useTranslation(),[p,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[m,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(l.EmptyResultInboxComp)}),[h,g]=n.useState(!1),y=r.useMemo(()=>l.isSearch?i.searchColumns(l):i.inboxColumns(l)||[],[]);let E;return l.isLoading?E=r.createElement(t.Loader,null):h?E=null:!s||0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?E=m&&r.createElement(m,{data:s})||(0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?r.createElement(t.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):r.createElement(t.Loader,null)):(null==s?void 0:s.length)>0&&(E=r.createElement(st,{t:c,data:s,columns:y,getCellProps:e=>({style:{minWidth:e.column.Header===c("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:l.onPageSizeChange,currentPage:l.currentPage,onNextPage:l.onNextPage,onPrevPage:l.onPrevPage,pageSizeLimit:l.pageSizeLimit,onSort:l.onSort,disableSort:l.disableSort,sortParams:l.sortParams,totalRecords:l.totalRecords})),r.createElement("div",{className:"inbox-container"},!l.isSearch&&r.createElement("div",{className:"filters-container"},r.createElement(ut,{parentRoute:l.parentRoute,businessService:l.moduleCode}),r.createElement("div",null,r.createElement(p,{defaultSearchParams:l.defaultSearchParams,onFilterChange:l.onFilterChange,searchParams:l.searchParams,type:"desktop",useNewInboxAPI:u,statusMap:u?null==s?void 0:s[0].statusMap:null,moduleCode:l.moduleCode}))),r.createElement("div",{style:{flex:1}},r.createElement(pt,{defaultSearchParams:l.defaultSearchParams,onSearch:e=>{l.onSearch(e),g(!1)},type:"desktop",searchFields:l.searchFields,isInboxPage:!(null!=l&&l.isSearch),searchParams:l.searchParams,clearSearch:()=>g(!0)}),r.createElement("div",{className:"result",style:{marginLeft:null!=l&&l.isSearch?"":"24px",flex:1}},E)))},vt=e=>{const{t:i}=o.useTranslation(),[a,l]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}});function s(){}return r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading"},r.createElement("div",{className:"filter-label"},i("SORT_BY"),":"),r.createElement("div",{className:"clearAll",onClick:s},i("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&r.createElement("span",{className:"clear-search",onClick:s},i("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&r.createElement("span",{onClick:e.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}]})))))},ht=e=>{let{t:o,data:i,onFilterChange:a,onSearch:l,onSort:s,serviceRequestIdKey:u,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:f,searchFields:m,sortParams:v,linkPrefix:h,filterComponent:g}=e;const[y,E]=n.useState(p?"SEARCH":""),[S,b]=n.useState(!!p),[_,A]=n.useState(v),[D]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{y&&b(!0)},[y]);const C=()=>{b(!1),E(""),A(v)};if(d)return r.createElement(t.Loader,null);let T;return i&&0!==(null==i?void 0:i.length)?i&&(null==i?void 0:i.length)>0&&(T=r.createElement(t.DetailsCard,{data:i,serviceRequestIdKey:u,linkPrefix:h||"/digit-ui/employee/ptr/"})):T=r.createElement(t.Card,{style:{marginTop:20}},o("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))),r.createElement(r.Fragment,null,r.createElement("div",{className:"searchBox"},l&&r.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{E("SEARCH"),b(!0)}}),!p&&a&&r.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{E("FILTER"),b(!0)}}),r.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{E("SORT"),b(!0)}})),T,S&&r.createElement(t.PopUp,null,"FILTER"===y&&r.createElement("div",{className:"popup-module"},r.createElement(D,{onFilterChange:e=>{a(e),b(!1)},Close:C,type:"mobile",searchParams:f})),"SORT"===y&&r.createElement("div",{className:"popup-module"},r.createElement(vt,{type:"mobile",sortParams:v,onClose:C,onSort:s})),"SEARCH"===y&&r.createElement("div",{className:"popup-module"},r.createElement(pt,{type:"mobile",onClose:C,onSearch:l,isFstpOperator:c,searchParams:f,searchFields:m}))))},gt=e=>{let{linkPrefix:a,classNameForMobileView:l=""}=e;const{t:s}=o.useTranslation(),u=[{text:s("ES_TITLE_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad"},{text:s("ES_TITILE_SEARCH_APPLICATION"),link:a+"/my-applications"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var n;t.accessTo?(n=t.accessTo,p.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),d(e)},[]),r.createElement(t.Card,{className:"employeeCard filter"},r.createElement("div",{className:"complaint-links-container "+l},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.ShippingTruck,null))," ",r.createElement("span",{className:"text"},s("ES_TITLE_ADD_BOOKING"))),r.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:o}=e;return r.createElement("span",{className:"link",key:t},r.createElement(i.Link,{to:n},o))}))))},yt=e=>{let{data:t,isLoading:n,isSearch:i,searchFields:a,onFilterChange:l,onSearch:s,onSort:u,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:f,tableConfig:m,filterComponent:v}=e;const{t:h}=o.useTranslation();return r.createElement("div",{style:{padding:0}},r.createElement("div",{className:"inbox-container"},r.createElement("div",{className:"filters-container"},!i&&r.createElement(gt,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),r.createElement(ht,{t:h,data:null==t?void 0:t.map(e=>{const t={};return(i?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:l,isLoading:n,isSearch:i,onSearch:s,onSort:u,searchParams:d,searchFields:a,linkPrefix:f,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:v}))))},Et=["isFetching","isLoading","searchResponseKey","data","searchFields"],St=e=>{var i,a,l,s,u;let{useNewInboxAPI:p,parentRoute:f,moduleCode:m="ADV",initialStates:v={},filterComponent:h,isInbox:g,rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:_,middlewaresWf:A,middlewareSearch:D,EmptyResultInboxComp:C}=e;const T=Digit.ULBService.getCurrentTenantId(),{t:x}=o.useTranslation(),[N,w]=n.useState(()=>g?{}:{enabled:!1}),[I,L]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("ADSInboxTableConfig")}),[k,O]=n.useState(v.pageOffset||0),[R,P]=n.useState(v.pageSize||10),[M,B]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[F,j]=n.useState(v.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),U=H?{limit:100,offset:0,sortBy:null==M||null===(i=M[0])||void 0===i?void 0:i.id,sortOrder:null!=M&&null!==(a=M[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:R,offset:k,sortBy:null==M||null===(l=M[0])||void 0===l?void 0:l.id,sortOrder:null!=M&&null!==(s=M[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const z=p?Digit.Hooks.useNewInboxGeneral({tenantId:T,ModuleCode:m,filters:c({},F,U,{sortParams:M},F.wfFilters||{})}):Digit.Hooks.useInboxGeneral({tenantId:T,businessService:m,isInbox:g,filters:c({},F,U,{sortParams:M},F.wfFilters||{}),rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:c({},N,_),middlewaresWf:A,middlewareSearch:D}),{isLoading:W,data:q,searchFields:V}=z,G=d(z,Et);n.useEffect(()=>{O(0)},[F]);const K=e=>{let t=e.delete,n=c({},F,e);t&&t.forEach(e=>delete n[e]),delete e.delete,j(c({},n)),w({enabled:!0})},Y=n.useCallback(e=>{0!==e.length&&B(e)},[]);var $;if(null!==(null==G||null===(u=G.data)||void 0===u?void 0:u.length))return H?r.createElement(yt,{data:q,isLoading:W,isSearch:!g,searchFields:V,onFilterChange:K,onSearch:K,onSort:Y,parentRoute:f,searchParams:F,sortParams:M,linkPrefix:f+"/application-details/",tableConfig:null!=G&&G.tableConfig?null==G?void 0:G.tableConfig:I(x).ADS,filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:p}):r.createElement("div",null,g&&r.createElement(t.Header,null,x("ES_COMMON_INBOX")),r.createElement(mt,{moduleCode:m,data:q,tableConfig:I(x).ADS,isLoading:W,defaultSearchParams:v.searchParams,isSearch:!g,onFilterChange:K,searchFields:V,onSearch:K,onSort:Y,onNextPage:()=>{O(e=>e+R)},onPrevPage:()=>{O(e=>e-R)},currentPage:Math.floor(k/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{P(Number(e.target.value))},parentRoute:f,searchParams:F,sortParams:M,totalRecords:Number(null==q||null===($=q[0])||void 0===$?void 0:$.totalCount),filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:p}))},bt=e=>{var n,a,l,s,u,d,p,f,m,v,h,g;let{path:y,userType:E}=e;o.useTranslation();const S=i.useLocation();sessionStorage.removeItem("revalidateddone"),window.Digit.Utils.browser.isMobile();const b=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("NewADSStepperForm"),_=(null===(l=Digit)||void 0===l||null===(s=l.ComponentRegistryService)||void 0===s||s.getComponent("NewSiteMasterStepperForm"),null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewSiteInspectionStepperForm")),D=(null===(p=Digit)||void 0===p||null===(f=p.ComponentRegistryService)||void 0===f||f.getComponent("ApplicationOverview"),null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("ADSResponseCitizen")),C=null===(h=Digit)||void 0===h||null===(g=h.ComponentRegistryService)||void 0===g?void 0:g.getComponent("ApplicationDetails"),T=window.location.href.includes("ads/response"),x=window.location.href.includes("searchad")||window.location.href.includes("modify-application")||window.location.href.includes("ads/application-details"),N={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ADV"],applicationStatus:[],locality:[]}};return r.createElement(i.Switch,null,r.createElement(t.AppContainer,null,r.createElement(r.Fragment,null,r.createElement("div",{className:"ground-container"},T?null:r.createElement("div",{style:x?{marginLeft:"12px",display:"flex",alignItems:"center"}:{marginLeft:"-4px",display:"flex",alignItems:"center"}},r.createElement(t.BackButton,{location:S})),r.createElement(t.PrivateRoute,{path:y+"/bookad",component:e=>r.createElement(b,c({},e,{userType:E}))}),r.createElement(t.PrivateRoute,{path:y+"/my-applications",component:e=>r.createElement(A,c({},e,{userType:"employee",parentRoute:y}))}),r.createElement(t.PrivateRoute,{path:y+"/applicationsearch/application-details/:id",component:()=>r.createElement(C,{parentRoute:y})}),r.createElement(t.PrivateRoute,{path:y+"/adsservice/:response/:bookingNo",component:D}),r.createElement(t.PrivateRoute,{path:y+"/site-inspection-details",component:_}),r.createElement(t.PrivateRoute,{path:y+"/inbox",component:()=>r.createElement(St,{useNewInboxAPI:!0,parentRoute:y,businessService:"ADV",filterComponent:"ADS_INBOX_FILTER",initialStates:N,isInbox:!0})}),r.createElement(t.PrivateRoute,{path:y+"/searchold",component:()=>r.createElement(St,{parentRoute:y,businessService:"ads",middlewareSearch:searchMW,initialStates:N,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})})))))},_t=e=>{let{t:t,createTime:o,onExpire:i}=e;const a=o?new Date(o).getTime()+18e5:null,[l,s]=n.useState(null);if(n.useEffect(()=>{if(!a)return;const e=()=>{const e=a-Date.now();s(e),e<=0&&"function"==typeof i&&i(!0)};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[a,i]),!a)return null;if(null!==l&&l<=0)return r.createElement("span",{style:{fontSize:"16px",color:"red",fontWeight:800}},t("ADS_SLOTS_EXPIRED"));if(null===l)return null;const u=null===Math||void 0===Math?void 0:Math.floor(l/6e4),c=null===Math||void 0===Math?void 0:Math.floor(l%6e4/1e3).toString().padStart(2,"0");return r.createElement("span",{style:{color:l<=6e4?"red":"#2947a3",fontWeight:600,fontSize:"14px",marginLeft:"8px"}},t("ADS_PAYMENT_TIMER"),r.createElement("span",{style:{fontSize:"16px",fontWeight:900,color:"red",marginLeft:"4px"}},u,":",c))},At=e=>{var a,l,s;let{application:u,buttonLabel:c}=e;const{t:d}=o.useTranslation(),p=i.useHistory(),[f,m]=n.useState(null);n.useEffect(()=>{if(f){const e=setTimeout(()=>{m(null)},2e3);return()=>clearTimeout(e)}},[f]);const v=new Date(null==u?void 0:u.applicationDate).toLocaleDateString(),[h,g]=n.useState(!1);return r.createElement(t.Card,null,"PENDING_FOR_PAYMENT"===u.bookingStatus&&(null==u||null===(a=u.auditDetails)||void 0===a?void 0:a.createdTime)&&r.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},r.createElement(_t,{t:d,createTime:null==u||null===(l=u.auditDetails)||void 0===l?void 0:l.createdTime,onExpire:e=>g(e)})),r.createElement(t.KeyNote,{keyValue:d("ADS_BOOKING_NO"),note:null==u?void 0:u.bookingNo}),r.createElement(t.KeyNote,{keyValue:d("ADS_APPLICANT_NAME"),note:null==u||null===(s=u.applicantDetail)||void 0===s?void 0:s.applicantName}),r.createElement(t.KeyNote,{keyValue:d("CS_APPLICATION_DETAILS_APPLICATION_DATE"),note:v}),r.createElement(t.KeyNote,{keyValue:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:d(""+(null==u?void 0:u.bookingStatus))}),r.createElement("div",null,r.createElement(i.Link,{to:"/digit-ui/citizen/ads/application/"+(null==u?void 0:u.bookingNo)+"/"+(null==u?void 0:u.tenantId)},r.createElement(t.SubmitBar,{label:c})),("/mybookingsPAYMENT_FAILED"===u.bookingStatus||"PENDING_FOR_PAYMENT"===u.bookingStatus)&&r.createElement(t.SubmitBar,{label:d("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{p.push("/digit-ui/citizen/payment/my-bills/adv-services/"+(null==u?void 0:u.bookingNo))},style:{margin:"20px"},disabled:h})),f&&r.createElement(t.Toast,{error:f.error,warning:f.warning,label:d(f.label),onClose:()=>{m(null)}}))};var Dt,Ct=Array.isArray,Tt="object"==typeof w&&w&&w.Object===Object&&w,xt="object"==typeof self&&self&&self.Object===Object&&self,Nt=Tt||xt||Function("return this")(),wt=Nt.Symbol,It=Object.prototype,Lt=It.hasOwnProperty,kt=It.toString,Ot=wt?wt.toStringTag:void 0,Rt=Object.prototype.toString,Pt=wt?wt.toStringTag:void 0,Mt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Pt&&Pt in Object(e)?function(e){var t=Lt.call(e,Ot),n=e[Ot];try{e[Ot]=void 0;var r=!0}catch(e){}var o=kt.call(e);return r&&(t?e[Ot]=n:delete e[Ot]),o}(e):function(e){return Rt.call(e)}(e)},Bt=function(e){return null!=e&&"object"==typeof e},Ft=function(e){return"symbol"==typeof e||Bt(e)&&"[object Symbol]"==Mt(e)},jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ht=/^\w*$/,Ut=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},zt=Nt["__core-js_shared__"],Wt=(Dt=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||""))?"Symbol(src)_1."+Dt:"",qt=Function.prototype.toString,Vt=function(e){if(null!=e){try{return qt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Gt=/^\[object .+?Constructor\]$/,Kt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ut(e)||(t=e,Wt&&Wt in t))&&(function(e){if(!Ut(e))return!1;var t=Mt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?Kt:Gt).test(Vt(e));var t}(n)?n:void 0},$t=Yt(Object,"create"),Xt=Object.prototype.hasOwnProperty,Zt=Object.prototype.hasOwnProperty;function Jt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jt.prototype.clear=function(){this.__data__=$t?$t(null):{},this.size=0},Jt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Jt.prototype.get=function(e){var t=this.__data__;if($t){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Xt.call(t,e)?t[e]:void 0},Jt.prototype.has=function(e){var t=this.__data__;return $t?void 0!==t[e]:Zt.call(t,e)},Jt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=$t&&void 0===t?"__lodash_hash_undefined__":t,this};var Qt=Jt,en=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(o=t)||r!=r&&o!=o)return n;var r,o;return-1},tn=Array.prototype.splice;function nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nn.prototype.clear=function(){this.__data__=[],this.size=0},nn.prototype.delete=function(e){var t=this.__data__,n=en(t,e);return!(n<0||(n==t.length-1?t.pop():tn.call(t,n,1),--this.size,0))},nn.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?void 0:t[n][1]},nn.prototype.has=function(e){return en(this.__data__,e)>-1},nn.prototype.set=function(e,t){var n=this.__data__,r=en(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var rn=nn,on=Yt(Nt,"Map"),an=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=function(){this.size=0,this.__data__={hash:new Qt,map:new(on||rn),string:new Qt}},ln.prototype.delete=function(e){var t=an(this,e).delete(e);return this.size-=t?1:0,t},ln.prototype.get=function(e){return an(this,e).get(e)},ln.prototype.has=function(e){return an(this,e).has(e)},ln.prototype.set=function(e,t){var n=an(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var sn=ln;function un(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(un.Cache||sn),n}un.Cache=sn;var cn,dn,pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/\\(\\)?/g,mn=(cn=un(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(pn,function(e,n,r,o){t.push(r?o.replace(fn,"$1"):n||e)}),t},function(e){return 500===dn.size&&dn.clear(),e}),dn=cn.cache,cn),vn=wt?wt.prototype:void 0,hn=vn?vn.toString:void 0,gn=function(e){if("string"==typeof e||Ft(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},yn=function(e,t,n){var r=null==e?void 0:function(e,t){for(var n=0,r=(t=function(e,t){return Ct(e)?e:function(e,t){if(Ct(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ft(e))||Ht.test(e)||!jt.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:mn(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Ct(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,e)+"";if(Ft(t))return hn?hn.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<r;)e=e[gn(t[n++])];return n&&n==r?e:void 0}(e,t);return void 0===r?n:r},En=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then};let Sn;const bn=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var _n=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},An=function(e){return bn[e]},Dn=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},Cn=function(){return void 0!==Sn},Tn=function(e){return Sn(e)},xn=I(function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}});function Nn(){this.buffer=[],this.length=0}Nn.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var wn=Nn;function In(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}In.prototype.set=function(e,t,n,r){const o=e*this.size+t;this.data[o]=n,r&&(this.reservedBit[o]=!0)},In.prototype.get=function(e,t){return this.data[e*this.size+t]},In.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},In.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Ln=In,kn=I(function(e,t){const n=_n;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),o=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e<t-1;e++)i[e]=i[e-1]-o;return i.push(6),i.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),o=r.length;for(let e=0;e<o;e++)for(let t=0;t<o;t++)0===e&&0===t||0===e&&t===o-1||e===o-1&&0===t||n.push([r[e],r[t]]);return n}});const On=_n;var Rn=I(function(e,t){function n(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,r=0,o=0,i=null,a=null;for(let l=0;l<t;l++){r=o=0,i=a=null;for(let s=0;s<t;s++){let t=e.get(l,s);t===i?r++:(r>=5&&(n+=r-5+3),i=t,r=1),t=e.get(s,l),t===a?o++:(o>=5&&(n+=o-5+3),a=t,o=1)}r>=5&&(n+=r-5+3),o>=5&&(n+=o-5+3)}return n},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){const t=e.get(r,o)+e.get(r,o+1)+e.get(r+1,o)+e.get(r+1,o+1);4!==t&&0!==t||n++}return 3*n},t.getPenaltyN3=function(e){const t=e.size;let n=0,r=0,o=0;for(let i=0;i<t;i++){r=o=0;for(let a=0;a<t;a++)r=r<<1&2047|e.get(i,a),a>=10&&(1488===r||93===r)&&n++,o=o<<1&2047|e.get(a,i),a>=10&&(1488===o||93===o)&&n++}return 40*n},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return 10*Math.abs(Math.ceil(100*t/n/5)-10)},t.applyMask=function(e,t){const r=t.size;for(let o=0;o<r;o++)for(let i=0;i<r;i++)t.isReserved(i,o)||t.xor(i,o,n(e,i,o))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let o=0,i=Infinity;for(let a=0;a<r;a++){n(a),t.applyMask(a,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),r<i&&(i=r,o=a)}return o}});const Pn=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Mn=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];var Bn=function(e,t){switch(t){case xn.L:return Pn[4*(e-1)+0];case xn.M:return Pn[4*(e-1)+1];case xn.Q:return Pn[4*(e-1)+2];case xn.H:return Pn[4*(e-1)+3];default:return}},Fn=function(e,t){switch(t){case xn.L:return Mn[4*(e-1)+0];case xn.M:return Mn[4*(e-1)+1];case xn.Q:return Mn[4*(e-1)+2];case xn.H:return Mn[4*(e-1)+3];default:return}};const jn=new Uint8Array(512),Hn=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)jn[t]=e,Hn[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)jn[e]=jn[e-255]}();var Un=function(e){return jn[e]},zn=function(e,t){return 0===e||0===t?0:jn[Hn[e]+Hn[t]]},Wn=I(function(e,t){t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let r=0;r<e.length;r++)for(let o=0;o<t.length;o++)n[r+o]^=zn(e[r],t[o]);return n},t.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const e=n[0];for(let r=0;r<t.length;r++)n[r]^=zn(t[r],e);let r=0;for(;r<n.length&&0===n[r];)r++;n=n.slice(r)}return n},t.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let r=0;r<e;r++)n=t.mul(n,new Uint8Array([1,Un(r)]));return n}});function qn(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}qn.prototype.initialize=function(e){this.degree=e,this.genPoly=Wn.generateECPolynomial(this.degree)},qn.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Wn.mod(t,this.genPoly),r=this.degree-n.length;if(r>0){const e=new Uint8Array(this.degree);return e.set(n,r),e}return n};var Vn=qn,Gn=function(e){return!isNaN(e)&&e>=1&&e<=40};let Kn="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Kn=Kn.replace(/u/g,"\\u");const Yn="(?:(?![A-Z0-9 $%*+\\-./:]|"+Kn+")(?:.|[\r\n]))+";var $n=new RegExp(Kn,"g"),Xn=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Zn=new RegExp(Yn,"g"),Jn=new RegExp("[0-9]+","g"),Qn=new RegExp("[A-Z $%*+\\-./:]+","g");const er=new RegExp("^"+Kn+"$"),tr=new RegExp("^[0-9]+$"),nr=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");var rr={KANJI:$n,BYTE_KANJI:Xn,BYTE:Zn,NUMERIC:Jn,ALPHANUMERIC:Qn,testKanji:function(e){return er.test(e)},testNumeric:function(e){return tr.test(e)},testAlphanumeric:function(e){return nr.test(e)}},or=I(function(e,t){t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Gn(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return rr.testNumeric(e)?t.NUMERIC:rr.testAlphanumeric(e)?t.ALPHANUMERIC:rr.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}}),ir=I(function(e,t){const n=Dn(7973);function r(e,t){return or.getCharCountIndicator(e,t)+4}function o(e,t){let n=0;return e.forEach(function(e){const o=r(e.mode,t);n+=o+e.getBitsLength()}),n}t.from=function(e,t){return Gn(e)?parseInt(e,10):t},t.getCapacity=function(e,t,n){if(!Gn(e))throw new Error("Invalid QR Code version");void 0===n&&(n=or.BYTE);const o=8*(An(e)-Fn(e,t));if(n===or.MIXED)return o;const i=o-r(n,e);switch(n){case or.NUMERIC:return Math.floor(i/10*3);case or.ALPHANUMERIC:return Math.floor(i/11*2);case or.KANJI:return Math.floor(i/13);case or.BYTE:default:return Math.floor(i/8)}},t.getBestVersionForData=function(e,n){let r;const i=xn.from(n,xn.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(o(e,r)<=t.getCapacity(r,n,or.MIXED))return r}(e,i);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,n,r){for(let o=1;o<=40;o++)if(n<=t.getCapacity(o,r,e))return o}(r.mode,r.getLength(),i)},t.getEncodedBits=function(e){if(!Gn(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;Dn(t)-n>=0;)t^=7973<<Dn(t)-n;return e<<12|t}});const ar=Dn(1335);function lr(e){this.mode=or.NUMERIC,this.data=e.toString()}lr.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},lr.prototype.getLength=function(){return this.data.length},lr.prototype.getBitsLength=function(){return lr.getBitsLength(this.data.length)},lr.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);const o=this.data.length-t;o>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*o+1))};var sr=lr;const ur=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function cr(e){this.mode=or.ALPHANUMERIC,this.data=e}cr.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},cr.prototype.getLength=function(){return this.data.length},cr.prototype.getBitsLength=function(){return cr.getBitsLength(this.data.length)},cr.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*ur.indexOf(this.data[t]);n+=ur.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(ur.indexOf(this.data[t]),6)};var dr=cr;function pr(e){this.mode=or.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}pr.getBitsLength=function(e){return 8*e},pr.prototype.getLength=function(){return this.data.length},pr.prototype.getBitsLength=function(){return pr.getBitsLength(this.data.length)},pr.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var fr=pr;function mr(e){this.mode=or.KANJI,this.data=e}mr.getBitsLength=function(e){return 13*e},mr.prototype.getLength=function(){return this.data.length},mr.prototype.getBitsLength=function(){return mr.getBitsLength(this.data.length)},mr.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Tn(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var vr=mr,hr=I(function(e){var t={single_source_shortest_paths:function(e,n,r){var o={},i={};i[n]=0;var a,l,s,u,c,d,p=t.PriorityQueue.make();for(p.push(n,0);!p.empty();)for(s in u=(a=p.pop()).cost,c=e[l=a.value]||{})c.hasOwnProperty(s)&&(d=u+c[s],(void 0===i[s]||i[s]>d)&&(i[s]=d,p.push(s,d),o[s]=l));if(void 0!==r&&void 0===i[r]){var f=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(f)}return o},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),r=e[r];return n.reverse(),n},find_path:function(e,n,r){var o=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,o={};for(n in e=e||{},r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=e.sorter||r.default_sorter,o},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}),gr=I(function(e,t){function n(e){return unescape(encodeURIComponent(e)).length}function r(e,t,n){const r=[];let o;for(;null!==(o=e.exec(n));)r.push({data:o[0],index:o.index,mode:t,length:o[0].length});return r}function o(e){const t=r(rr.NUMERIC,or.NUMERIC,e),n=r(rr.ALPHANUMERIC,or.ALPHANUMERIC,e);let o,i;return Cn()?(o=r(rr.BYTE,or.BYTE,e),i=r(rr.KANJI,or.KANJI,e)):(o=r(rr.BYTE_KANJI,or.BYTE,e),i=[]),t.concat(n,o,i).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function i(e,t){switch(t){case or.NUMERIC:return sr.getBitsLength(e);case or.ALPHANUMERIC:return dr.getBitsLength(e);case or.KANJI:return vr.getBitsLength(e);case or.BYTE:return fr.getBitsLength(e)}}function a(e,t){let n;const r=or.getBestModeForData(e);if(n=or.from(t,r),n!==or.BYTE&&n.bit<r.bit)throw new Error('"'+e+'" cannot be encoded with mode '+or.toString(n)+".\n Suggested mode is: "+or.toString(r));switch(n!==or.KANJI||Cn()||(n=or.BYTE),n){case or.NUMERIC:return new sr(e);case or.ALPHANUMERIC:return new dr(e);case or.KANJI:return new vr(e);case or.BYTE:return new fr(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(a(t,null)):t.data&&e.push(a(t.data,t.mode)),e},[])},t.fromString=function(e,r){const a=function(e,t){const n={},r={start:{}};let o=["start"];for(let a=0;a<e.length;a++){const l=e[a],s=[];for(let e=0;e<l.length;e++){const u=l[e],c=""+a+e;s.push(c),n[c]={node:u,lastCount:0},r[c]={};for(let e=0;e<o.length;e++){const a=o[e];n[a]&&n[a].node.mode===u.mode?(r[a][c]=i(n[a].lastCount+u.length,u.mode)-i(n[a].lastCount,u.mode),n[a].lastCount+=u.length):(n[a]&&(n[a].lastCount=u.length),r[a][c]=i(u.length,u.mode)+4+or.getCharCountIndicator(u.mode,t))}}o=s}for(let e=0;e<o.length;e++)r[o[e]].end=0;return{map:r,table:n}}(function(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];switch(o.mode){case or.NUMERIC:t.push([o,{data:o.data,mode:or.ALPHANUMERIC,length:o.length},{data:o.data,mode:or.BYTE,length:o.length}]);break;case or.ALPHANUMERIC:t.push([o,{data:o.data,mode:or.BYTE,length:o.length}]);break;case or.KANJI:t.push([o,{data:o.data,mode:or.BYTE,length:n(o.data)}]);break;case or.BYTE:t.push([{data:o.data,mode:or.BYTE,length:n(o.data)}])}}return t}(o(e,Cn())),r),l=hr.find_path(a.map,"start","end"),s=[];for(let e=1;e<l.length-1;e++)s.push(a.table[l[e]].node);return t.fromArray(s.reduce(function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[]))},t.rawSplit=function(e){return t.fromArray(o(e,Cn()))}});function yr(e,t,n){const r=e.size,o=function(e,t){const n=e.bit<<3|t;let r=n<<10;for(;Dn(r)-ar>=0;)r^=1335<<Dn(r)-ar;return 21522^(n<<10|r)}(t,n);let i,a;for(i=0;i<15;i++)a=1==(o>>i&1),e.set(i<6?i:i<8?i+1:r-15+i,8,a,!0),e.set(8,i<8?r-i-1:i<9?15-i-1+1:15-i-1,a,!0);e.set(r-8,8,1,!0)}var Er=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,r,o=xn.M;return void 0!==t&&(o=xn.from(t.errorCorrectionLevel,xn.M),n=ir.from(t.version),r=Rn.from(t.maskPattern),t.toSJISFunc&&function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Sn=e}(t.toSJISFunc)),function(e,t,n,r){let o;if(Array.isArray(e))o=gr.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let r=t;if(!r){const t=gr.rawSplit(e);r=ir.getBestVersionForData(t,n)}o=gr.fromString(e,r||40)}}const i=ir.getBestVersionForData(o,n);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<i)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+i+".\n")}else t=i;const a=function(e,t,n){const r=new wn;n.forEach(function(t){r.put(t.mode.bit,4),r.put(t.getLength(),or.getCharCountIndicator(t.mode,e)),t.write(r)});const o=8*(An(e)-Fn(e,t));for(r.getLengthInBits()+4<=o&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(0);const i=(o-r.getLengthInBits())/8;for(let e=0;e<i;e++)r.put(e%2?17:236,8);return function(e,t,n){const r=An(t),o=r-Fn(t,n),i=Bn(t,n),a=i-r%i,l=Math.floor(r/i),s=Math.floor(o/i),u=s+1,c=l-s,d=new Vn(c);let p=0;const f=new Array(i),m=new Array(i);let v=0;const h=new Uint8Array(e.buffer);for(let e=0;e<i;e++){const t=e<a?s:u;f[e]=h.slice(p,p+t),m[e]=d.encode(f[e]),p+=t,v=Math.max(v,t)}const g=new Uint8Array(r);let y,E,S=0;for(y=0;y<v;y++)for(E=0;E<i;E++)y<f[E].length&&(g[S++]=f[E][y]);for(y=0;y<c;y++)for(E=0;E<i;E++)g[S++]=m[E][y];return g}(r,e,t)}(t,n,o),l=_n(t),s=new Ln(l);return function(e,t){const n=e.size,r=function(e){const t=On(e);return[[0,0],[t-7,0],[0,t-7]]}(t);for(let t=0;t<r.length;t++){const o=r[t][0],i=r[t][1];for(let t=-1;t<=7;t++)if(!(o+t<=-1||n<=o+t))for(let r=-1;r<=7;r++)i+r<=-1||n<=i+r||e.set(o+t,i+r,t>=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4,!0)}}(s,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(s),function(e,t){const n=kn.getPositions(t);for(let t=0;t<n.length;t++){const r=n[t][0],o=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)e.set(r+t,o+n,-2===t||2===t||-2===n||2===n||0===t&&0===n,!0)}}(s,t),yr(s,n,0),t>=7&&function(e,t){const n=e.size,r=ir.getEncodedBits(t);let o,i,a;for(let t=0;t<18;t++)o=Math.floor(t/3),i=t%3+n-8-3,a=1==(r>>t&1),e.set(o,i,a,!0),e.set(i,o,a,!0)}(s,t),function(e,t){const n=e.size;let r=-1,o=n-1,i=7,a=0;for(let l=n-1;l>0;l-=2)for(6===l&&l--;;){for(let n=0;n<2;n++)if(!e.isReserved(o,l-n)){let r=!1;a<t.length&&(r=1==(t[a]>>>i&1)),e.set(o,l-n,r),i--,-1===i&&(a++,i=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}(s,a),isNaN(r)&&(r=Rn.getBestMask(s,yr.bind(null,s,n))),Rn.applyMask(r,s),yr(s,n,r),{modules:s,version:t,errorCorrectionLevel:n,maskPattern:r,segments:o}}(e,n,o,r)},Sr=I(function(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=e.width&&e.width>=21?e.width:void 0;return{width:t,scale:t?4:e.scale||4,margin:null==e.margin||e.margin<0?4:e.margin,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const o=n.modules.size,i=n.modules.data,a=t.getScale(o,r),l=Math.floor((o+2*r.margin)*a),s=r.margin*a,u=[r.color.light,r.color.dark];for(let t=0;t<l;t++)for(let n=0;n<l;n++){let c=4*(t*l+n),d=r.color.light;t>=s&&n>=s&&t<l-s&&n<l-s&&(d=u[i[Math.floor((t-s)/a)*o+Math.floor((n-s)/a)]?1:0]),e[c++]=d.r,e[c++]=d.g,e[c++]=d.b,e[c]=d.a}}}),br=I(function(e,t){t.render=function(e,t,n){let r=n,o=t;void 0!==r||t&&t.getContext||(r=t,t=void 0),t||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),r=Sr.getOptions(r);const i=Sr.getImageWidth(e.modules.size,r),a=o.getContext("2d"),l=a.createImageData(i,i);return Sr.qrToImageData(l.data,e,r),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,o,i),a.putImageData(l,0,0),o},t.renderToDataURL=function(e,n,r){let o=r;return void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={}),t.render(e,n,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}});function _r(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function Ar(e,t,n){let r=e+t;return void 0!==n&&(r+=" "+n),r}function Dr(e,t,n,r,o){const i=[].slice.call(arguments,1),a=i.length,l="function"==typeof i[a-1];if(!l&&!En())throw new Error("Callback required as last argument");if(!l){if(a<1)throw new Error("Too few arguments provided");return 1===a?(n=t,t=r=void 0):2!==a||t.getContext||(r=n,n=t,t=void 0),new Promise(function(o,i){try{const i=Er(n,r);o(e(i,t,r))}catch(e){i(e)}})}if(a<2)throw new Error("Too few arguments provided");2===a?(o=n,n=t,t=r=void 0):3===a&&(t.getContext&&void 0===o?(o=r,r=void 0):(o=r,r=n,n=t,t=void 0));try{const i=Er(n,r);o(null,e(i,t,r))}catch(e){o(e)}}var Cr={create:Er,toCanvas:Dr.bind(null,br.render),toDataURL:Dr.bind(null,br.renderToDataURL),toString:Dr.bind(null,function(e,t,n){return function(e,t,n){const r=Sr.getOptions(t),o=e.modules.size,i=e.modules.data,a=o+2*r.margin,l=r.color.light.a?"<path "+_r(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",s="<path "+_r(r.color.dark,"stroke")+' d="'+function(e,t,n){let r="",o=0,i=!1,a=0;for(let l=0;l<e.length;l++){const s=Math.floor(l%t),u=Math.floor(l/t);s||i||(i=!0),e[l]?(a++,l>0&&s>0&&e[l-1]||(r+=i?Ar("M",s+n,.5+u+n):Ar("m",o,0),o=0,i=!1),s+1<t&&e[l+1]||(r+=Ar("h",a),a=0)):o++}return r}(i,o,r.margin)+'"/>';return'<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+'viewBox="0 0 '+a+" "+a+'" shape-rendering="crispEdges">'+l+s+"</svg>\n"}(e,n)})};const Tr=function(e,t){try{console.log("application",e);const n=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"});return Promise.resolve(Cr.toDataURL(window.location.href)).then(function(r){var o,i,a,l,s;const u="\n<html>\n <head>\n <title>"+t("ADS_ACKNOWLEDGMENT_FORM")+'</title>\n <style>\n @page { margin: 0.5in; }\n body { \n font-family: \'Arial\', sans-serif; \n margin: 0; \n padding: 20px;\n font-size: 14px;\n line-height: 1.6;\n }\n .acknowledgement-container {\n max-width: 800px;\n margin: 0 auto;\n border: 2px solid #333;\n padding: 30px;\n background: white;\n }\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n margin-bottom: 30px;\n border-bottom: 2px solid #333;\n padding-bottom: 20px;\n position: relative;\n }\n .header-left,\n .header-right {\n flex: 0 0 auto;\n }\n .header-center {\n text-align: center;\n flex: 1;\n }\n .title {\n font-size: 20px;\n font-weight: bold;\n margin: 10px 0;\n color: #333;\n }\n .subtitle {\n font-size: 16px;\n margin: 5px 0;\n color: #666;\n }\n .acknowledgement-text {\n margin: 20px 0;\n text-align: justify;\n font-size: 15px;\n }\n .details-table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n }\n .details-table th,\n .details-table td {\n padding: 12px;\n text-align: left;\n border: 1px solid #ddd;\n }\n .details-table th {\n background: #f5f5f5;\n font-weight: bold;\n width: 40%;\n }\n .footer {\n margin-top: 30px;\n text-align: center;\n font-size: 12px;\n color: #666;\n }\n @media print {\n body { background: white !important; }\n }\n </style>\n </head>\n <body>\n <div class="acknowledgement-container">\n <div class="header">\n <div class="header-left">\n <img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/'+(null==e?void 0:e.tenantId)+'/logo.png" \n style="width: 120px; height: 120px;" />\n </div>\n <div class="header-center">\n <div class="title">Advertisement and Hoarding Booking Acknowledgement</div>\n <div class="subtitle">Municipal Corporation</div>\n </div>\n <div class="header-right">\n <img src="'+r+'" style="width: 120px; height: 120px;" />\n </div>\n </div>\n\n <div class="acknowledgement-text">\n '+t("ADV_ACK_TEXT_2")+" \n </div>\n\n <h3>"+t("ADS_APPLICANT_DETAILS")+'</h3>\n <table class="details-table">\n <tr>\n <th>'+t("WS_COMMON_TABLE_COL_APP_NO_LABEL")+"</th>\n <td>"+((null==e?void 0:e.bookingNo)||"Not Available")+"</td>\n </tr>\n <tr>\n <th>"+t("BPA_BASIC_DETAILS_APPLICATION_DATE_LABEL")+"</th>\n <td>"+(null!=e&&e.applicationDate?new Date(null==e?void 0:e.applicationDate).toLocaleDateString("en-GB"):"N/A")+"</td>\n </tr>\n <tr>\n <th>"+t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL")+"</th>\n <td>"+((null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantName)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("PDF_STATIC_LABEL_WS_CONSOLIDATED_CONCERNED_PLUMBER_CONTACT")+"</th>\n <td>"+((null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantMobileNo)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("ADS_ALTERNATE_NUMBER")+"</th>\n <td>"+((null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.applicantAlternateMobileNo)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_EMAIL")+"</th>\n <td>"+((null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantEmailId)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("TL_HOME_SEARCH_RESULTS_APP_STATUS_LABEL")+'</th>\n <td style="color: #28a745; font-weight: bold;">'+(t(null==e?void 0:e.bookingStatus)||"SUBMITTED")+"</td>\n </tr>\n </table>\n\n "+((null==e||null===(s=e.cartDetails)||void 0===s?void 0:s.length)>0?"\n <h3>"+t("ADVERTISEMENT_DETAILS")+'</h3>\n <table class="details-table">\n <tr>\n <th>'+t("ADS_AD_TYPE")+"</th>\n <th>"+t("CS_ADDCOMPLAINT_LOCATION")+"</th>\n <th>"+t("ADS_FACE_AREA")+"</th>\n <th>"+t("CHB_BOOKING_DATE")+"</th>\n <th>"+t("ADS_FROM_TIME")+"</th>\n <th>"+t("ADS_TO_TIME")+"</th>\n <th>"+t("ADS_NIGHT_LIGHT")+"</th>\n <th>"+t("PT_OWNERSHIP_INFO_NAME")+"</th>\n <th>"+t("POLE_NO")+"</th>\n </tr>\n "+e.cartDetails.map(e=>"\n <tr>\n <td>"+(t(e.addType)||"N/A")+"</td>\n <td>"+(t(e.location)||"N/A")+"</td>\n <td>"+(t(e.faceArea.replace(e.addType+"_",""))||"N/A")+"</td>\n <td>"+(e.bookingDate||"N/A")+"</td>\n <td>"+(e.bookingFromTime||"N/A")+"</td>\n <td>"+(e.bookingToTime||"N/A")+"</td>\n <td>"+(e.nightLight?"With Light":"Without Light")+"</td>\n <td>"+(e.advertisementName||"N/A")+"</td>\n <td>"+(e.poleNo||"N/A")+"</td>\n </tr>\n ").join("")+"\n </table>\n ":"")+'\n\n <div class="acknowledgement-text">\n '+t("ADV_ACK_TEXT_1")+'\n </div>\n \n <div class="footer">\n <p>Generated on: '+n+"</p>\n <p>Municipal Corporation</p>\n <p>This is a computer-generated document and does not require a signature.</p>\n </div>\n </div>\n </body>\n</html>\n",c=window.open("","_blank");c.document.write(u),c.document.close(),c.onload=()=>{setTimeout(()=>{c.print(),c.onafterprint=()=>{c.close()}},500)}})}catch(e){return Promise.reject(e)}},xr=e=>{let{cartDetails:o,t:i}=e;const a=e=>(null==e?void 0:e.id)+"_"+(null==e?void 0:e.bookingStartDate)+"_"+(null==e?void 0:e.bookingEndDate),[l,s]=n.useState(()=>null==o?void 0:o.map(e=>a(null==e?void 0:e.ad)));return r.createElement("div",{style:{marginTop:"1rem"}},0===(null==o?void 0:o.length)?r.createElement("p",{style:{padding:"12px",color:"#666"}},i("ADS_NO_ADVERTISMENT_DETAILS")):null==o?void 0:o.map((e,n)=>{var o,u,c,d,p,f;const m=a(null==e?void 0:e.ad),v=null==l?void 0:l.includes(m);return r.createElement("div",{key:n,style:{marginBottom:"16px",border:"1px solid #ddd",borderRadius:"8px",overflow:"hidden"}},r.createElement("div",{onClick:()=>(e=>{s(t=>null!=t&&t.includes(e)?null==t?void 0:t.filter(t=>t!==e):[...t,e])})(m),style:{background:"#f9f9f9",padding:"10px 14px",fontWeight:600,fontSize:"14px",borderBottom:"1px solid #ddd",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement("span",null,i(null!=(o=null==e||null===(u=e.ad)||void 0===u?void 0:u.name)?o:null==e||null===(c=e.ad)||void 0===c?void 0:c.location),null!=e&&null!==(d=e.ad)&&void 0!==d&&d.amount?" — ₹"+(1.18*(null==e||null===(p=e.ad)||void 0===p?void 0:p.amount)*(null==e||null===(f=e.slots)||void 0===f?void 0:f.length)).toFixed(2):""),r.createElement("span",{style:{fontSize:"18px"}},v?"▾":"▸")),v&&r.createElement("div",{style:{overflowX:"auto"}},r.createElement(t.Table,{t:i,data:e.slots,columns:[{Header:i("ADS_DATE"),accessor:"bookingDate"},{Header:i("ADS_LOCATION"),accessor:"location",Cell:e=>{let{value:t}=e;return i(t||"N/A")}},{Header:i("ADS_FACE_AREA"),accessor:"faceArea",Cell:e=>{let{value:t}=e;return i((null==t?void 0:t.replaceAll("_"," "))||"N/A")}},{Header:i("ADS_TYPE"),accessor:"addType"},{Header:i("ADS_NIGHT_LIGHT"),accessor:e=>i(e.nightLight?"ADS_YES":"ADS_NO")}],disableSort:!0,isPaginationRequired:!1,getCellProps:e=>({style:{padding:"12px 14px",fontSize:"14px",borderBottom:"1px solid #f0f0f0",textAlign:"left",whiteSpace:"nowrap"}})})))}))},Nr=["tenantId","payments"],wr=["tenantId","payments"],Ir=e=>r.createElement("h1",{className:"heading-m"},e.label),Lr=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),kr=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(Lr,null)),Or=e=>{var o,i,a;let{t:l,action:s,tenantId:u,closeModal:d,submitAction:p,applicationData:f,businessService:m,workflowActions:v,showToast:h,closeToast:g,errors:y}=e;const[E,S]=n.useState({}),[b,_]=n.useState({}),[A,D]=n.useState([]),[C,T]=n.useState({}),[x,N]=n.useState(null),[w,I]=n.useState(null),[L,k]=n.useState(null),[O,R]=n.useState([]),[P,M]=n.useState(null),B=new Set(["SUBMIT","INITIATE","PAY"]),F=(null==s?void 0:s.fromStateCode)||(null==s||null===(o=s._rawStateObj)||void 0===o?void 0:o.state)||null,j=(null==s?void 0:s.toStateCode)||null,H=(null==s?void 0:s.status)||(B.has(null==s?void 0:s.action)?j||F||(null==s?void 0:s.nextState):F||j||(null==s?void 0:s.nextState)),{data:U}=Digit.Hooks.useEmployeeSearch(u,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:z}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'ADV')]"}]}]}});n.useEffect(()=>{var e;z&&z["egf-master"]&&R(null===(e=z["egf-master"])||void 0===e?void 0:e.FinancialYear)},[z]);const{data:W}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function q(e){N(e.target.files[0])}return n.useEffect(()=>{if(U&&W){var e;const t=W["common-masters"].Department;D(null==U||null===(e=U.Employees)||void 0===e?void 0:e.map(e=>{var n,r,o;const i=null==e||null===(n=e.assignments)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===i);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[U]),n.useEffect(()=>{!function(){try{k(null);const e=function(){if(x){const e=function(){if(x.size>=5242880)k(l("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=tt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",x,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):k(l("CS_FILE_UPLOAD_ERROR"))})},function(){k(l("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[x]),n.useEffect(()=>{v&&v.length>0&&v.find(e=>e.action===(null==s?void 0:s.action))},[v,s]),n.useEffect(()=>{s&&S((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:l,selectFile:s,uploadedFile:u,setUploadedFile:c}=e,d=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SENDBACK"!=(null==o?void 0:o.action)||(d=!1),o.isTerminateState&&(d=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:""+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:d?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:d?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:d?r.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:l,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:r.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:l,action:s,approvers:A,selectedApprover:C,setSelectedApprover:T,selectFile:q,uploadedFile:w,setUploadedFile:I,businessService:m}))},[s,A,O,P,w]),s&&E.form?r.createElement(t.Modal,{headerBarMain:r.createElement(Ir,{label:l(E.label.heading)}),headerBarEnd:r.createElement(kr,{onClick:d}),actionCancelLabel:l(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:l(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},r.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){f=c({},f,{action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,status:H,wfDocuments:w?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]:null}),p({Licenses:[f]})},defaultValues:b,formId:"modal-action"}),h&&r.createElement(t.Toast,{error:"error"===h.key,label:y,onClose:g})):r.createElement(t.Loader,null)};var Rr;!function(){try{Yt(Object,"defineProperty")({},"",{})}catch(e){}}(),Rr=function(){return arguments}(),Bt(Rr)&&Mt(Rr);var Pr=function(){return!1},Mr=(I(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?Nt.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Pr}),I(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n&&Tt.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),I(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?Nt.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=i?i(n):new e.constructor(n);return e.copy(r),r}}),Yt(Nt,"DataView")),Br=Yt(Nt,"Promise"),Fr=Yt(Nt,"Set"),jr=Yt(Nt,"WeakMap"),Hr=Vt(Mr),Ur=Vt(on),zr=Vt(Br),Wr=Vt(Fr),qr=Vt(jr),Vr=Mt;(Mr&&"[object DataView]"!=Vr(new Mr(new ArrayBuffer(1)))||on&&"[object Map]"!=Vr(new on)||Br&&"[object Promise]"!=Vr(Br.resolve())||Fr&&"[object Set]"!=Vr(new Fr)||jr&&"[object WeakMap]"!=Vr(new jr))&&(Vr=function(e){var t=Mt(e),n="[object Object]"==t?e.constructor:void 0,r=n?Vt(n):"";if(r)switch(r){case Hr:return"[object DataView]";case Ur:return"[object Map]";case zr:return"[object Promise]";case Wr:return"[object Set]";case qr:return"[object WeakMap]"}return t});const Gr=["tenantId","payments"],Kr=["tenantId","payments"],Yr=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),l=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},s={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},u={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),i.length);return r.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},r.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return r.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},r.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:r.createElement("div",{className:"step-number",style:u}),r.createElement("div",{className:"step-label",style:s},a(i[t].stepLabel))),r.createElement("div",{className:"step-circle",style:l(t+1)},t+1,t<d-1&&r.createElement("div",{style:c})));var o})),r.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},$r=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const l=t.filter(e=>e.isStepEnabled),{t:s}=o.useTranslation();function u(){i<l.length?d():i===l.length&&n()}function c(){i>1&&p()}const d=()=>a(i+1),p=()=>a(i-1);return r.createElement(Yr,{currentStep:i,nextStep:d,prevStep:p,stepsList:l},(()=>{var e,t;const n=l[i-1],{component:o,key:a,texts:d,currStepConfig:p}=n,f=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return r.createElement(r.Fragment,null,r.createElement(f,{config:{key:a,texts:d,component:o,currStepNumber:i,currStepConfig:p},onGoNext:u,onBackClick:c,t:s}))})())},Xr=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInCitizen:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:"penalty"}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Zr=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Jr=(e,t)=>({type:"UPDATE_ADSNewApplication_FORM",payload:{key:e,value:t}}),Qr=e=>({type:"SET_ADSNewApplication_STEP",payload:e}),eo=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"ads",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_APPLICANT_DETAILA",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}]),to=[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"ads",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_APPLICANT_DETAILA",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}],no=e=>{var o,i,l;let{t:u,goNext:d,currentStepData:p,onGoBack:f,onChange:m=(()=>{})}=e;const v=s.useDispatch(),h=Digit.UserService.getUser(),g=window.location.href.includes("citizen"),y=g?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),{mobileNumber:E,emailId:S,name:b}=null==h?void 0:h.info,[_,A]=n.useState(null),{control:D,handleSubmit:C,setValue:T,formState:{errors:x},trigger:N}=a.useForm({mode:"onChange",defaultValues:{name:g&&b||"",emailId:g&&S||"",mobileNumber:g&&E||"",address:"",pincode:""}});n.useEffect(()=>{if(null!=p&&p.CreatedResponse){const e=null==p?void 0:p.CreatedResponse;null!=e&&e.address&&(T("address",e.address.addressLine1||""),T("pincode",e.address.pincode||"")),null!=e&&e.applicantDetail&&(T("name",e.applicantDetail.applicantName||""),T("emailId",e.applicantDetail.applicantEmailId||""),T("mobileNumber",e.applicantDetail.applicantMobileNo||""))}},[p,T]),n.useEffect(()=>{if(_){const e=setTimeout(()=>A(null),2e3);return()=>clearTimeout(e)}},[_]);const w={marginTop:"-18px",color:"red"},I={color:"red"};return r.createElement("form",{onSubmit:C(function(e){try{var t,n;const r=Date.now(),o=null==p||null===(t=p.ads)||void 0===t?void 0:t.flatMap(e=>e.slots.map(t=>c({},t,{advertisementId:e.ad.id,status:"BOOKED"}))),i={tenantId:y,applicationDate:r,bookingStatus:"BOOKING_CREATED",businessService:"ADV",address:{pincode:(null==e?void 0:e.pincode)||"",addressLine1:(null==e?void 0:e.address)||""},applicantDetail:{applicantName:e.name||"",applicantEmailId:e.emailId||"",applicantMobileNo:e.mobileNumber||"",applicantDetailId:""},owners:[{name:e.name||"",mobileNumber:e.mobileNumber||"",tenantId:y,type:"CITIZEN"}],cartDetails:o,documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}};if(null==p||null===(n=p.CreatedResponse)||void 0===n?void 0:n.bookingNo)return d(i),Promise.resolve();const a=tt(function(){return Promise.resolve(Digit.ADSServices.create({bookingApplication:i},y)).then(function(e){var t;const n=null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status;if("string"==typeof n&&"successful"===n.toLowerCase()){const t=Array.isArray(null==e?void 0:e.bookingApplication)?e.bookingApplication[0]:null==e?void 0:e.bookingApplication;v(Jr("CreatedResponse",t||e)),d(i)}else v(Jr("CreatedResponse",{draft:!0,bookingApplication:i})),A({key:!0,label:u("CORE_SOMETHING_WENT_WRONG")})})},function(){A({key:!0,label:u("CORE_SOMETHING_WENT_WRONG")})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",{style:{maxWidth:!g&&"500px"}},r.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("ES_NEW_APPLICATION_APPLICANT_NAME")," ",r.createElement("span",{style:I},"*")," "),r.createElement(a.Controller,{control:D,name:"name",rules:{required:u("Applicant Name is Required"),pattern:{value:/^[A-Za-z]+(?:[ '-][A-Za-z]+)*\s*$/,message:u("Applicant Name is Invalid")},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:e=>{i(e),N("name")},t:u})}}),(null==x?void 0:x.name)&&r.createElement(t.CardLabelError,{style:w},null==x||null===(o=x.name)||void 0===o?void 0:o.message),r.createElement(t.CardLabel,null,u("NOC_APPLICANT_EMAIL_LABEL"),r.createElement("span",{style:I},"*")),r.createElement(a.Controller,{control:D,name:"emailId",rules:{required:u("PTR_EMAIL_REQUIRED"),pattern:{value:/^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/,message:"Enter a valid email"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:i,t:u})}}),x.emailId&&r.createElement(t.CardLabelError,{style:w},x.emailId.message),r.createElement(t.CardLabel,null,u("NOC_APPLICANT_MOBILE_NO_LABEL"),r.createElement("span",{style:I},"*")),r.createElement(a.Controller,{control:D,name:"mobileNumber",rules:{required:u("PTR_MOBILE_REQUIRED"),minLength:{value:10,message:"Enter at least 10 digits"},pattern:{value:/^[6-9]\d{9}$/,message:"Must start with 9, 8, 7, or 6 and be 10 digits long"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.MobileNumber,{value:n,onChange:o,onBlur:i,t:u})}}),x.mobileNumber&&r.createElement(t.CardLabelError,{style:w},x.mobileNumber.message),r.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("PT_COMMON_COL_ADDRESS"),r.createElement("span",{style:I},"*")),r.createElement("div",{className:"field"},r.createElement(a.Controller,{control:D,name:"address",rules:{required:u("NDC_MESSAGE_ADDRESS"),pattern:{value:/^[A-Za-z0-9\s.,'/-]+$/,message:u("PTR_ADDRESS_INVALID")},maxLength:{value:500,message:"Maximum 500 characters"},minLength:{value:5,message:"Minimum 5 characters"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextArea,{value:n,onChange:e=>o(e.target.value),onBlur:e=>{i(e),N("address")},t:u})}})),(null==x?void 0:x.address)&&r.createElement(t.CardLabelError,{style:w},null==x||null===(i=x.address)||void 0===i?void 0:i.message),r.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("CORE_COMMON_PINCODE"),r.createElement("span",{style:I},"*")),r.createElement("div",{className:"field"},r.createElement(a.Controller,{control:D,name:"pincode",rules:{required:u("PTR_PINCODE_REQUIRED"),pattern:{value:/^[1-9][0-9]{5}$/,message:u("PTR_PINCODE_INVALID")},minLength:{value:6,message:u("PTR_PINCODE_MIN_LENGTH")},maxLength:{value:6,message:u("PTR_PINCODE_MAX_LENGTH")}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value.replace(/\D/g,"")),onBlur:e=>{i(e),N("pincode")},t:u,maxLength:6})}})),x.pincode&&r.createElement(t.CardLabelError,{style:w},null==x||null===(l=x.pincode)||void 0===l?void 0:l.message)),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:f}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})),_&&r.createElement(t.Toast,{error:_.key,label:u(_.label),onClose:()=>{A(null)},isDleteBtn:!0}))},ro=e=>{var o;let{ad:i,tenantId:a,onClose:l,onSelectSlot:s,dateRange:u,t:d,cartSlots:p,onRemoveSlot:f}=e;const[m,v]=n.useState([]),[h,g]=n.useState(!1),y=n.useMemo(()=>({advertisementSlotSearchCriteria:[{advertisementId:null==i?void 0:i.id,bookingId:"",addType:null==i?void 0:i.adType,bookingStartDate:null==u?void 0:u.startDate,bookingEndDate:null==u?void 0:u.endDate,faceArea:(null==i?void 0:i.adType)+"_"+(null==i?void 0:i.width)+"_X_"+(null==i?void 0:i.height),tenantId:a,location:null==i?void 0:i.locationCode,nightLight:"With Light"===(null==i?void 0:i.light)?"true":"false",isTimerRequired:!1,amount:null==i?void 0:i.amount}]}),[i,a,u]),{data:E={},isLoading:S}=Digit.Hooks.ads.useADSSlotSearch({tenantId:a,type:!0,data:y}),b=(null==E?void 0:E.advertisementSlotAvailabiltityDetails)||[],_=(null==p||null===(o=p.find(e=>{var t,n,r;return(null==e||null===(t=e.ad)||void 0===t?void 0:t.id)===(null==i?void 0:i.id)&&(null==e||null===(n=e.ad)||void 0===n?void 0:n.bookingStartDate)===(null==u?void 0:u.startDate)&&(null==e||null===(r=e.ad)||void 0===r?void 0:r.bookingEndDate)===(null==u?void 0:u.endDate)}))||void 0===o?void 0:o.slots)||[],A=(null==b?void 0:b.length)>0&&(null==b?void 0:b.every(e=>"AVAILABLE"!==(null==e?void 0:e.slotStaus))),D=null==b?void 0:b.filter(e=>"AVAILABLE"===(null==e?void 0:e.slotStaus)),C=(null==D?void 0:D.length)>0&&(null==D?void 0:D.every(e=>null==_?void 0:_.some(t=>(null==t?void 0:t.bookingDate)===(null==e?void 0:e.bookingDate))));n.useEffect(()=>{C&&g(!0)},[C]);const T=!function(e,t){var n,r,o,i;if(void 0===e&&(e=[]),void 0===t&&(t=[]),(null===(n=e)||void 0===n?void 0:n.length)!==(null===(r=t)||void 0===r?void 0:r.length))return!1;const a=e=>null==e?void 0:e.bookingDate,l=null===(o=e)||void 0===o?void 0:o.map(a).sort(),s=null===(i=t)||void 0===i?void 0:i.map(a).sort();return(null===JSON||void 0===JSON?void 0:JSON.stringify(l))===(null===JSON||void 0===JSON?void 0:JSON.stringify(s))}(m,_);n.useEffect(()=>{null!=i&&i.id&&(null==_?void 0:_.length)>0?(g(!0),v(_)):(g(!1),v([]))},[i,u]);const x=[{Header:()=>r.createElement("input",{type:"checkbox",checked:h,disabled:A,onChange:e=>(e=>{if(g(e),e){const e=null==b?void 0:b.filter(e=>"AVAILABLE"===(null==e?void 0:e.slotStaus));v(e)}else v([])})(e.target.checked),style:{cursor:A?"not-allowed":"pointer",width:"18px",height:"18px",accentColor:"#0b74de"}}),accessor:"select",Cell:e=>{let{row:t}=e;const n=null==t?void 0:t.original;return r.createElement("input",{type:"checkbox",checked:h&&"AVAILABLE"===(null==n?void 0:n.slotStaus),disabled:!0,style:{cursor:"not-allowed",width:"18px",height:"18px",accentColor:"#0b74de"}})}},{Header:d("ADS_DATE"),accessor:"bookingDate"},{Header:d("ADS_LOCATION"),accessor:"location",Cell:e=>{let{value:t}=e;return d(t||"N/A")}},{Header:d("ADS_FACE_AREA"),accessor:"faceArea",Cell:e=>{let{value:t}=e;return d((null==t?void 0:t.replaceAll("_"," "))||"N/A")}},{Header:d("ADS_TYPE"),accessor:"addType"},{Header:d("ADS_NIGHT_LIGHT"),accessor:e=>d(e.nightLight?"ADS_YES":"ADS_NO")},{Header:d("ADS_STATUS"),accessor:"slotStaus",Cell:e=>{var t;let{row:n}=e;const o=null==n||null===(t=n.original)||void 0===t?void 0:t.slotStaus,i="AVAILABLE"===o;return r.createElement("span",{style:{display:"inline-block",padding:"5px 14px",borderRadius:"20px",fontSize:"12px",fontWeight:600,color:i?"#155724":"#721c24",backgroundColor:i?"#d4edda":"#f8d7da",border:"1px solid "+(i?"#c3e6cb":"#f5c6cb"),textTransform:"capitalize"}},o)}}];return r.createElement("div",{style:{position:"fixed",top:"70px",left:0,width:"100vw",height:"calc(100vh - 70px)",background:"rgba(0,0,0,0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e3}},r.createElement("div",{style:{width:"90%",maxWidth:"1100px",height:"70vh",background:"#fff",borderRadius:"12px",padding:"20px",display:"flex",flexDirection:"column",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",borderBottom:"1px solid #eee",paddingBottom:"8px"}},r.createElement("h2",{style:{margin:0,fontSize:"20px",fontWeight:700,color:"#333"}},d("ADS_AVAILIBILITY_FOR")," ",null==i?void 0:i.name," ",A&&r.createElement("span",{style:{color:"#c62828",fontSize:"14px",marginLeft:"8px"}},d("ADS_ALL_SLOTS_BOOKED"))),r.createElement("button",{onClick:l,style:{border:"none",background:"transparent",fontSize:"22px",cursor:"pointer",color:"#666"}},"✖")),r.createElement("div",{style:{flex:1,overflowY:"auto",border:"1px solid #ddd",borderRadius:"8px"}},S?r.createElement("div",{style:{fontSize:"24px",color:"#555",textAlign:"center"}},d("ADS_LOADING_SLOTS")):0===(null==b?void 0:b.length)?r.createElement("div",{style:{fontSize:"24px",color:"#555",textAlign:"center"}},d("ADS_NO_SLOTS_AVAILABLE")):r.createElement(t.Table,{t:d,data:b,columns:x,disableSort:!0,isPaginationRequired:!1,getCellProps:e=>({style:{padding:"12px 14px",fontSize:"14px",borderBottom:"1px solid #f0f0f0",textAlign:"left",backgroundColor:e.row.index%2==0?"#fafafa":"#fff"}})})),r.createElement("div",{style:{marginTop:"12px",display:"flex",justifyContent:"flex-end",gap:"10px"}},r.createElement("button",{onClick:l,style:{padding:"10px 18px",borderRadius:"6px",border:"1px solid #ccc",background:"#f5f5f5",cursor:"pointer"}},d?d("Cancel"):"Cancel"),r.createElement("button",{onClick:()=>{(null==m?void 0:m.length)>0?s(m,c({},i,{faceArea:(null==i?void 0:i.adType)+"_"+(null==i?void 0:i.width)+"_X_"+(null==i?void 0:i.height),location:null==i?void 0:i.name,addType:null==i?void 0:i.adType,amount:null==i?void 0:i.amount,bookingDate:null==u?void 0:u.startDate,nightLight:"With Light"===(null==i?void 0:i.light),bookingStartDate:null==u?void 0:u.startDate,bookingEndDate:null==u?void 0:u.endDate}),u):(null==_?void 0:_.length)>0&&f(i,u),v([]),g(!1),l()},disabled:!T,style:{padding:"10px 18px",borderRadius:"6px",border:"none",background:T?"#2947a3":"#ccc",color:"#fff",fontWeight:600,cursor:T?"pointer":"not-allowed",transition:"background 0.2s"}},"🛒 ",d((null==_?void 0:_.length)>0?"COMMON_REMOVE_LABEL":"ADS_ADD_TO_CART")))))},oo=e=>{let{cartSlots:o,onClose:i,onRemoveSlot:a,t:l}=e;const s=e=>(null==e?void 0:e.id)+"_"+(null==e?void 0:e.bookingStartDate)+"_"+(null==e?void 0:e.bookingEndDate),[u,c]=n.useState(()=>null==o?void 0:o.map(e=>s(e.ad)));return r.createElement("div",{style:{position:"fixed",top:"70px",left:0,width:"100vw",height:"calc(100vh - 70px)",background:"rgba(0,0,0,0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e3}},r.createElement("div",{style:{width:"90%",maxWidth:"1100px",height:"70vh",background:"#fff",borderRadius:"12px",padding:"20px",display:"flex",flexDirection:"column",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",borderBottom:"1px solid #eee",paddingBottom:"8px"}},r.createElement("h2",{style:{margin:0,fontSize:"20px",fontWeight:700,color:"#333"}},l("ADS_YOUR_CART")),r.createElement("button",{onClick:i,style:{border:"none",background:"transparent",fontSize:"22px",cursor:"pointer",color:"#666"}},"✖")),r.createElement("div",{style:{flex:1,overflowY:"auto"}},0===(null==o?void 0:o.length)?r.createElement("p",{style:{padding:"12px",color:"#666"}},l("ADS_NO_ITEMS_IN_CART")):null==o?void 0:o.map((e,n)=>{var o,i,d,p;const f=s(null==e?void 0:e.ad),m=null==u?void 0:u.includes(f);return r.createElement("div",{key:f,style:{marginBottom:"16px",border:"1px solid #ddd",borderRadius:"8px",overflow:"hidden"}},r.createElement("div",{style:{background:"#f9f9f9",padding:"10px 14px",fontWeight:600,fontSize:"14px",borderBottom:"1px solid #ddd",display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement("div",{onClick:()=>(e=>{c(t=>null!=t&&t.includes(e)?null==t?void 0:t.filter(t=>t!==e):[...t,e])})(f),style:{cursor:"pointer",flex:1}},null==e||null===(o=e.ad)||void 0===o?void 0:o.name,null!=e&&null!==(i=e.ad)&&void 0!==i&&i.amount?" — ₹"+(1.18*(null==e||null===(d=e.ad)||void 0===d?void 0:d.amount)*(null==e||null===(p=e.slots)||void 0===p?void 0:p.length)).toFixed(2):"",r.createElement("span",{style:{fontSize:"18px",marginLeft:"8px"}},m?"▾":"▸")),r.createElement("button",{onClick:()=>{var t,n;return a(null==e?void 0:e.ad,{startDate:null==e||null===(t=e.ad)||void 0===t?void 0:t.bookingStartDate,endDate:null==e||null===(n=e.ad)||void 0===n?void 0:n.bookingEndDate})},style:{padding:"6px 12px",borderRadius:"6px",border:"none",background:"#dc3545",color:"#fff",cursor:"pointer",fontSize:"12px",marginLeft:"10px"}},l("ADS_REMOVE"))),m&&r.createElement("div",{style:{overflowX:"auto"}},r.createElement(t.Table,{t:l,data:null==e?void 0:e.slots,columns:[{Header:l("ADS_DATE"),accessor:"bookingDate"},{Header:l("ADS_LOCATION"),accessor:"location",Cell:e=>{let{value:t}=e;return l(t||"N/A")}},{Header:l("ADS_FACE_AREA"),accessor:"faceArea",Cell:e=>{let{value:t}=e;return l((null==t?void 0:t.replaceAll("_"," "))||"N/A")}},{Header:l("ADS_TYPE"),accessor:"addType"},{Header:l("ADS_NIGHT_LIGHT"),accessor:e=>l(null!=e&&e.nightLight?"ADS_YES":"ADS_NO")},{Header:l("ADS_STATUS"),accessor:"slotStaus",Cell:e=>{var t;let{row:n}=e;const o=null==n||null===(t=n.original)||void 0===t?void 0:t.slotStaus,i="AVAILABLE"===o;return r.createElement("span",{style:{display:"inline-block",padding:"5px 14px",borderRadius:"20px",fontSize:"12px",fontWeight:600,color:i?"#155724":"#721c24",backgroundColor:i?"#d4edda":"#f8d7da",border:"1px solid "+(i?"#c3e6cb":"#f5c6cb"),textTransform:"capitalize"}},o)}}],disableSort:!0,isPaginationRequired:!1,getCellProps:e=>({style:{padding:"12px 14px",fontSize:"14px",borderBottom:"1px solid #f0f0f0",textAlign:"left",whiteSpace:"nowrap"}})})))}))))},io=e=>{let{ad:t,idx:n,control:o,watch:i,t:l,onViewAvailability:s=(()=>{}),cartSlots:u=[],openCart:c,scheduleType:d}=e;const p=i("ads."+n+".startDate")||"",f=function(e){const t=new Date,n=t.getFullYear(),r=t.getMonth();return"Monthly"===e||"Weekly"===e||"FortNight"===e?new Date(n,r,1).toISOString().split("T")[0]:"Yearly"===e?r<3?new Date(n-1,3,1).toISOString().split("T")[0]:new Date(n,3,1).toISOString().split("T")[0]:t.toISOString().split("T")[0]}(d),m=null==u?void 0:u.some(e=>{var n,r;return(null==e||null===(n=e.ad)||void 0===n?void 0:n.id)===(null==t?void 0:t.id)&&(null==e||null===(r=e.slots)||void 0===r?void 0:r.length)>0});return r.createElement("div",{style:{width:280,borderRadius:8,padding:9,background:"#fff",boxShadow:"0 4px 10px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",gap:8}},r.createElement("div",{style:{width:"100%",height:120,borderRadius:8,overflow:"hidden",background:"#f5f5f5"}},t.imageSrc||t.photoURL?r.createElement("img",{src:(null==t?void 0:t.imageSrc)||(null==t?void 0:t.photoURL),alt:(null==t?void 0:t.name)||"Ad "+(null==t?void 0:t.id),loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover"}}):r.createElement("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#aaa"}},l("ADS_NO_IMAGE"))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:13,color:"#444"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontWeight:600}},r.createElement("span",null,t.name),r.createElement("span",{style:{color:"#222"}},"₹",null==t?void 0:t.amount)),r.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},r.createElement("span",null,null==t?void 0:t.locationCode),r.createElement("span",null,"Pole ",t.poleNo)),r.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},r.createElement("span",null,null==t?void 0:t.adType),r.createElement("span",{style:{color:"green",fontWeight:600}},null==t?void 0:t.light))),r.createElement("div",{style:{fontSize:12,color:"#666",marginTop:6}},l("ADS_START_DATE_TIME")),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement(a.Controller,{control:o,name:"ads."+n+".startDate",render:e=>r.createElement("input",{type:"date",min:f,value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{flex:1,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})}),r.createElement(a.Controller,{control:o,name:"ads."+n+".startTime",render:e=>r.createElement("input",{type:"time",value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{width:110,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})})),r.createElement("div",{style:{fontSize:12,color:"#666",marginTop:6}},l("ADS_END_DATE_TIME")),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement(a.Controller,{control:o,name:"ads."+n+".endDate",render:e=>r.createElement("input",{type:"date",min:p||f,value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{flex:1,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})}),r.createElement(a.Controller,{control:o,name:"ads."+n+".endTime",render:e=>r.createElement("input",{type:"time",value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{width:110,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})})),r.createElement("div",{style:{display:"flex",gap:8,marginTop:6}},r.createElement("button",{type:"button",onClick:()=>s(t,{startDate:i("ads."+n+".startDate"),endDate:i("ads."+n+".endDate"),startTime:i("ads."+n+".startTime"),endTime:i("ads."+n+".endTime")}),style:{flex:1,padding:"6px 12px",borderRadius:6,background:"#2947a3",color:"#fff",border:"none",cursor:"pointer",fontSize:14}},l("ADS_VIEW_AVAILABILITY"),"👁️"),m&&r.createElement("button",{type:"button",onClick:c,style:{width:110,padding:"6px 12px",borderRadius:6,background:"#28a745",color:"#fff",fontSize:14,fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},r.createElement("span",{style:{color:"black"}},"🛒"),l("ADS_IN_CART"))))},ao=e=>{var o,i,l;let{goNext:u,currentStepData:d,t:p}=e;const f="undefined"!=typeof window&&(null===(o=window.location)||void 0===o||null===(i=o.href)||void 0===i?void 0:i.includes("citizen")),v=f?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),[h,g]=n.useState([]),[y,E]=n.useState(null),[S,b]=n.useState(6),[_,A]=n.useState(!1),[D,C]=n.useState(!1),[T,x]=n.useState(null),[N,w]=n.useState({startDate:"",endDate:""}),{data:I=[]}=Digit.Hooks.ads.useADSAllMDMS(v),{data:L=[]}=Digit.Hooks.ads.useADSLocationMDMS(v),{data:k=[]}=Digit.Hooks.ads.useADSScheduleTypeMDMS(v),[O,R]=n.useState([]),P=s.useDispatch(),{control:M,handleSubmit:B,setValue:F,watch:j,formState:{errors:H}}=a.useForm({defaultValues:{siteId:null,geoLocation:null,ads:[]}}),U=n.useMemo(()=>{if(!I||!L)return[];const e=new Map;L.forEach(t=>{null!=t&&t.code&&e.set(t.code,t)});const t=new Set(I.map(e=>e.locationCode).filter(Boolean));return Array.from(t).map(t=>e.get(t)).filter(Boolean)},[I,L]);n.useEffect(()=>{b(6)},[h.length]);const z=e=>{var t,n;const r=I.filter(t=>String(t.locationCode)===String(e.code));g(r),F("ads",[]);const o=Array.isArray(L)&&L.find(t=>String(t.code)===String(e.code))||null;null!=o&&null!==(t=o.geo_tag)&&void 0!==t&&t.latitude&&null!=o&&null!==(n=o.geo_tag)&&void 0!==n&&n.longitude&&F("geoLocation",{formattedAddress:o.name||e.code,latitude:o.geo_tag.latitude,longitude:o.geo_tag.longitude,lat:o.geo_tag.latitude,lng:o.geo_tag.longitude,placeId:o.locationCode})};n.useEffect(()=>{const e=h.map(()=>({startDate:"",startTime:"",endDate:"",endTime:""}));F("ads",e,{shouldValidate:!1,shouldDirty:!1})},[h,F]),n.useEffect(()=>{if(y){const e=setTimeout(()=>E(null),2e3);return()=>clearTimeout(e)}},[y]);const W=(e,t)=>{let{startDate:n,endDate:r,startTime:o,endTime:i}=t;const a=(e=>{let{startDate:t,endDate:n,startTime:r,endTime:o,scheduleType:i}=e;if(!(t&&n&&r&&o))return"Start and end date/time are required.";const a=m(new Date(t)),l=m(new Date(n)),s=a.getFullYear(),u=a.getMonth(),c=new Date(s,u+1,0).getDate();switch(i){case"Monthly":{const e=m(new Date(s,u,1)),t=m(new Date(s,u,c));if(t<m(new Date))return"This Monthly block ("+e.toDateString()+" – "+t.toDateString()+") is already in the past. Please select a future month.";if(a.getTime()!==e.getTime()||l.getTime()!==t.getTime())return"For Monthly, you must select "+e.toDateString()+" to "+t.toDateString();break}case"Weekly":{const e=a.getDate();let t,n;e>=1&&e<=7?(t=1,n=7):e>=8&&e<=15?(t=8,n=15):e>=16&&e<=23?(t=16,n=23):(t=24,n=c);const r=m(new Date(s,u,t)),o=m(new Date(s,u,n));if(o<m(new Date))return"This weekly block ("+t+"-"+n+" "+a.toLocaleString("default",{month:"long"})+") is already in the past. Please select a future block.";if(a.getTime()!==r.getTime()||l.getTime()!==o.getTime())return"For Weekly, you must select "+t+"-"+n+" of "+a.toLocaleString("default",{month:"long"});break}case"FortNight":{const e=m(new Date(s,u,1)),t=m(new Date(s,u,15)),n=m(new Date(s,u,16)),r=m(new Date(s,u,c)),o=m(new Date);if(a.getTime()===e.getTime()&&t<o||a.getTime()===n.getTime()&&r<o)return"This FortNight block is already in the past. Please select a future block.";if(!(a.getTime()===e.getTime()&&l.getTime()===t.getTime()||a.getTime()===n.getTime()&&l.getTime()===r.getTime()))return"For FortNight, you must select 1–15 or 16–"+c+" of "+a.toLocaleString("default",{month:"long"});break}case"Yearly":{let e,t;if(u<3?(e=m(new Date(s-1,3,1)),t=m(new Date(s,2,31))):(e=m(new Date(s,3,1)),t=m(new Date(s+1,2,31))),a.getTime()!==e.getTime()||l.getTime()!==t.getTime())return"For Yearly, you must select "+e.toDateString()+" to "+t.toDateString()+" (Financial Year)";break}default:return"Invalid schedule type."}return null})({startDate:n,endDate:r,startTime:o,endTime:i,scheduleType:k});if(a)return void E({label:a,error:!0});const l=L.find(t=>t.code===(null==e?void 0:e.locationCode));x(c({},e,{locationName:l,startDate:n,endDate:r})),w({startDate:n,endDate:r,startTime:o,endTime:i}),A(!0)},q=(e,t)=>{R(n=>n.filter(n=>{var r,o,i;return!((null==n||null===(r=n.ad)||void 0===r?void 0:r.id)===(null==e?void 0:e.id)&&(null==n||null===(o=n.ad)||void 0===o?void 0:o.bookingStartDate)===(null==t?void 0:t.startDate)&&(null==n||null===(i=n.ad)||void 0===i?void 0:i.bookingEndDate)===(null==t?void 0:t.endDate))})),E({label:"Removed slots for "+(null==e?void 0:e.name)+" ("+(null==t?void 0:t.startDate)+" → "+(null==t?void 0:t.endDate)+")",error:!0})};n.useEffect(()=>{var e;if((null==d||null===(e=d.ads)||void 0===e?void 0:e.length)>0){var t,n,r,o;R(d.ads);const e=null===(t=d.ads[0])||void 0===t||null===(n=t.ad)||void 0===n?void 0:n.locationCode,i=null==U?void 0:U.find(t=>t.code===e);i&&(F("siteId",i),z(i)),null!=i&&null!==(r=i.geo_tag)&&void 0!==r&&r.latitude&&null!=i&&null!==(o=i.geo_tag)&&void 0!==o&&o.longitude&&F("geoLocation",{formattedAddress:i.name,latitude:i.geo_tag.latitude,longitude:i.geo_tag.longitude,lat:i.geo_tag.latitude,lng:i.geo_tag.longitude,placeId:i.code})}},[d,U]);const V=function(e,t){switch(e){case"Monthly":return t("ADS_GUIDE_MONTHLY");case"Weekly":return t("ADS_GUIDE_WEEKLY");case"FortNight":return t("ADS_GUIDE_FORTNIGHT");case"Yearly":return t("ADS_GUIDE_YEARLY");default:return""}}(k,p);return r.createElement(r.Fragment,null,(null==O?void 0:O.length)>0&&r.createElement("div",{style:{display:"flex",justifyContent:"end"}},r.createElement("button",{style:{marginLeft:"12px",padding:"8px 16px",background:"#2947a3",color:"#fff",border:"none",borderRadius:"6px",cursor:"pointer"},onClick:()=>C(!0)},r.createElement("span",{style:{marginRight:6}},"🛒"),p("ADS_VIEW_CART")," (",null==O?void 0:O.length,")")),r.createElement("form",{onSubmit:B(function(e){try{var t,n;if(0===(null==O?void 0:O.length))return E({label:p("ADS_ONE_AD_ATLEAST"),error:!0}),Promise.resolve();if((null==d||null===(t=d.ads)||void 0===t?void 0:t.length)>0&&function(e,t){var n,r;if(void 0===e&&(e=[]),void 0===t&&(t=[]),(null===(n=e)||void 0===n?void 0:n.length)!==(null===(r=t)||void 0===r?void 0:r.length))return!1;const o=e=>{var t;return null===(t=[...e])||void 0===t?void 0:t.sort((e,t)=>{var n,r;return String(null==e||null===(n=e.ad)||void 0===n?void 0:n.id).localeCompare(String(null==t||null===(r=t.ad)||void 0===r?void 0:r.id))})},i=o(e),a=o(t);return i.every((e,t)=>{var n,r,o,i,l,s;const u=a[t];if(String(null==e||null===(n=e.ad)||void 0===n?void 0:n.id)!==String(null==u||null===(r=u.ad)||void 0===r?void 0:r.id))return!1;const c=null==e||null===(o=e.slots)||void 0===o||null===(i=o.map(e=>null==e?void 0:e.bookingDate))||void 0===i?void 0:i.sort(),d=null==u||null===(l=u.slots)||void 0===l||null===(s=l.map(e=>null==e?void 0:e.bookingDate))||void 0===s?void 0:s.sort();return(null==c?void 0:c.length)===(null==d?void 0:d.length)&&(null==c?void 0:c.every((e,t)=>e===d[t]))})}(O,null==d?void 0:d.ads))return u(O),Promise.resolve();const e={advertisementSlotSearchCriteria:null!=(n=null==O?void 0:O.flatMap(e=>e.slots.map(e=>c({},e,{isTimerRequired:!0}))))?n:[]},r=tt(function(){return Promise.resolve(Digit.ADSServices.slot_search(e,v)).then(function(e){if(e){const e=Date.now();P(Jr("reservationExpiry",e)),u(O)}else E({label:p("COMMON_SOMETHING_WENT_WRONG_LABEL"),error:!0})})},function(){E({label:p("COMMON_SOMETHING_WENT_WRONG_LABEL"),error:!0})});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement(t.CardLabel,null,p("ADS_SITE_NAME_LABEL")," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement("div",{style:{width:"100%"}},f&&r.createElement("style",null,"\n .form-field {\n width: 100% !important;\n }\n .select-wrap {\n width: 100% !important;\n }\n .select {\n border: 1px solid #b4b4b4 !important;\n border-radius: 8px !important;\n height: 2.9rem !important;\n }\n .select-active {\n border: 1px solid #2947a3 !important;\n border-radius: 8px !important;\n }\n "),r.createElement(a.Controller,{control:M,name:"siteId",rules:{required:p("ADS_SITE_NAME_REQUIRED")},render:e=>r.createElement(t.Dropdown,{className:"form-field",option:U,optionKey:"name",selected:e.value,select:t=>{e.onChange(t),z(t)}})})),H.siteId&&r.createElement(t.CardLabelError,{style:{marginTop:"-18px",color:"red"}},H.siteId.message),V&&(null==h?void 0:h.length)>0&&r.createElement("div",{style:{background:"#fff3cd",border:"1px solid #ffeeba",color:"#856404",padding:"6px 10px",borderRadius:"6px",fontSize:"14px",marginBottom:"8px",width:"100%",maxWidth:"545px"}},"⚠️ ",V),(null==h?void 0:h.length)>0&&r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:12}},null==h||null===(l=h.slice(0,S))||void 0===l?void 0:l.map((e,t)=>r.createElement(io,{key:e.id||t,ad:e,idx:t,control:M,watch:j,cartSlots:O,onViewAvailability:W,openCart:()=>C(!0),t:p,scheduleType:k}))),(null==h?void 0:h.length)>6&&r.createElement("div",{style:{textAlign:"center",marginTop:"1rem"}},S<h.length?r.createElement("button",{type:"button",style:{padding:"8px 12px",borderRadius:6,border:"1px solid #ccc",background:"#fff",cursor:"pointer"},onClick:()=>b(e=>e+6)},p("ADS_SHOW_MORE")):r.createElement("button",{type:"button",style:{padding:"8px 12px",borderRadius:6,border:"1px solid #ccc",background:"#fff",cursor:"pointer"},onClick:()=>b(6)},p("SHOW_LESS"))),r.createElement(t.CardLabel,null,p("CS_COMPLAINT_DETAILS_GEO_LOCATION")),r.createElement(a.Controller,{control:M,name:"geoLocation",render:e=>r.createElement(lt,{value:e.value,onChange:e.onChange,t:p})}),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})),_&&r.createElement(ro,{ad:T,tenantId:v,onClose:()=>A(!1),onSelectSlot:(e,t,n)=>{R(r=>{const o=null==e?void 0:e.map(e=>c({},e,{bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==n?void 0:n.endDate,bookingFromTime:null==n?void 0:n.startTime,bookingToTime:null==n?void 0:n.endTime}));let i;return r.find(e=>{var r,o,i;return(null==e||null===(r=e.ad)||void 0===r?void 0:r.id)===(null==t?void 0:t.id)&&(null==e||null===(o=e.ad)||void 0===o?void 0:o.bookingStartDate)===(null==n?void 0:n.startDate)&&(null==e||null===(i=e.ad)||void 0===i?void 0:i.bookingEndDate)===(null==n?void 0:n.endDate)})?(i=r.map(e=>{var r,i,a;return(null==e||null===(r=e.ad)||void 0===r?void 0:r.id)===(null==t?void 0:t.id)&&(null==e||null===(i=e.ad)||void 0===i?void 0:i.bookingStartDate)===(null==n?void 0:n.startDate)&&(null==e||null===(a=e.ad)||void 0===a?void 0:a.bookingEndDate)===(null==n?void 0:n.endDate)?c({},e,{slots:o}):e}),E({label:"Updated "+o.length+" slot(s) for "+(null==t?void 0:t.name)+" ("+(null==n?void 0:n.startDate)+" → "+(null==n?void 0:n.endDate)+")",error:!1})):(i=[...r,{ad:c({},t,{bookingStartDate:null==n?void 0:n.startDate,bookingEndDate:null==n?void 0:n.endDate}),slots:o}],E({label:"Added "+(null==o?void 0:o.length)+" slot(s) to "+(null==t?void 0:t.name)+" ("+(null==n?void 0:n.startDate)+" → "+(null==n?void 0:n.endDate)+")",error:!1})),i})},cartSlots:O,t:p,dateRange:N,onRemoveSlot:q}),D&&r.createElement(oo,{cartSlots:O,onClose:()=>C(!1),onRemoveSlot:q,t:p}),y&&r.createElement(t.Toast,{error:y.error,label:p?p(y.label):y.label,onClose:()=>E(null),isDleteBtn:!0})))},lo=e=>{let{t:o,goNext:i,currentStepData:l,onGoBack:s}=e;const{control:u,handleSubmit:c,setValue:d,watch:p,formState:{errors:f}}=a.useForm({defaultValues:{penalty:"No",penaltyAmount:"",referenceId:""}}),m=p("penalty");return n.useEffect(()=>{l&&Object.entries(l).forEach(e=>{let[t,n]=e;d(t,null!=n?n:"")})},[l,d]),r.createElement("form",{onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),i(e)})},r.createElement(t.CardLabel,null,o("Penalty")),r.createElement(a.Controller,{name:"penalty",control:u,render:e=>r.createElement("div",{style:{display:"flex",gap:"20px"}},r.createElement("label",null,r.createElement("input",{type:"radio",value:"Yes",checked:"Yes"===e.value,onChange:()=>e.onChange("Yes")})," ","Yes"),r.createElement("label",null,r.createElement("input",{type:"radio",value:"No",checked:"No"===e.value,onChange:()=>e.onChange("No")})," ","No"))}),r.createElement(t.CardLabel,null,o("Penalty Amount")),r.createElement(a.Controller,{name:"penaltyAmount",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.penaltyAmount&&r.createElement("p",{style:{color:"red"}},f.penaltyAmount.message),r.createElement(t.CardLabel,null,o("Reference ID")),r.createElement(a.Controller,{name:"referenceId",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.referenceId&&r.createElement("p",{style:{color:"red"}},f.referenceId.message),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:"white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),s(e)})}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})))},so=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSSiteMaster",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"null"}]}],uo=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"SITE_MASTER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteMasterFormStepOne",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]),co=[{i18nKey:"ADS_AVAILABLE",code:"AVAILABLE",name:"Available"},{i18nKey:"ADS_UNAVAILABLE",code:"UNAVAILABLE",name:"Unavailable"}],po=e=>{let{goNext:o,currentStepData:i,t:l}=e;const u=Digit.ULBService.getStateId(),{data:d=[]}=Digit.Hooks.ads.useADSAllMDMS(u),p=new Date;p.setMinutes(p.getMinutes()-p.getTimezoneOffset());const f=p.toISOString().slice(11,16),m=window.location.href.includes("citizen"),v={siteId:"",siteName:"",geoLocation:null,cartAddress:"",size:"",advertisementType:"",availabilityStatus:"",gstApplicable:!1,cowCessApplicable:!1,rate:""},{control:h,handleSubmit:g,setValue:y,watch:E,reset:S,formState:{errors:b}}=a.useForm({defaultValues:v}),_=(new Date).getTime(),A=e=>{var t;const n=x[e];n&&(S(c({},v,n,{bookingFromTime:n.bookingFromTime||f,bookingToTime:n.bookingToTime||f})),I(e),T((null===(t=n.geoLocation)||void 0===t?void 0:t.formattedAddress)||""))},D=s.useDispatch(),[C,T]=n.useState(""),[x,N]=n.useState([]),[w,I]=n.useState(null),L=g(e=>{null!==w&&w>=0?(N(t=>t.map((t,n)=>n===w?e:t)),I(null)):N(t=>[...t,e]),S(c({},v,{bookingFromTime:f,bookingToTime:f})),T("")});return n.useEffect(()=>{const e=(null==i?void 0:i.siteDetails)||i;e&&(Object.entries(e).forEach(e=>{let[t,n]=e;y(t,n)}),e.bookingFromTime||y("bookingFromTime",f),e.bookingToTime||y("bookingToTime",f))},[i,y]),n.useEffect(()=>{var e;const t=E("siteName");!t||!t.geo_tag||E("geoLocation")&&null!==(e=E("geoLocation"))&&void 0!==e&&e.latitude||(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!1}),T(t.name))},[E("siteName")]),r.createElement(r.Fragment,null,x.length>0&&r.createElement("div",{style:{margin:"12px 0",padding:8,border:"1px dashed #ddd",borderRadius:6}},r.createElement("div",{style:{fontWeight:600,marginBottom:8}},l?l("Added Advertisements"):"Added Advertisements"),x.map((e,t)=>{var n,o,i;return r.createElement("div",{key:t,style:{display:"flex",justifyContent:"space-between",gap:8,alignItems:"center",padding:"6px 0",borderBottom:t<x.length-1?"1px solid #eee":"none",cursor:"pointer",background:w===t?"#fafafa":"transparent",paddingRight:12}},r.createElement("div",{onClick:()=>A(t),style:{flex:1}},r.createElement("div",{style:{fontSize:13,fontWeight:500}},(null===(n=e.siteName)||void 0===n?void 0:n.name)||e.siteId||"Ad "+(t+1)),r.createElement("div",{style:{fontSize:12,color:"#666"}},e.cartAddress||(null===(o=e.geoLocation)||void 0===o?void 0:o.formattedAddress)||(null!==(i=e.geoLocation)&&void 0!==i&&i.latitude?e.geoLocation.latitude+", "+e.geoLocation.longitude:""))),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement("button",{type:"button",onClick:()=>A(t),style:{background:"#fff",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Edit"):"Edit"),r.createElement("button",{type:"button",onClick:()=>{return e=t,N(t=>t.filter((t,n)=>n!==e)),void(w===e?(I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),T("")):null!==w&&w>e&&I(e=>null!==e?e-1:null));var e},style:{background:"transparent",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Remove"):"Remove")))})),r.createElement("form",{onSubmit:g(function(e){try{var t,n,r,a,l,s,u,d,p,h,g;const y=m?"pb.amritsar":"pb.testing",E=(null==i||null===(t=i.ownerDetails)||void 0===t?void 0:t.address)||{},b=[...x,e],A={addressLine1:E.addressline1||E.addressLine1||"",city:(null===(n=E.city)||void 0===n?void 0:n.name)||E.city||"",cityCode:E.cityCode||(null===(r=E.city)||void 0===r?void 0:r.code)||"",houseNo:E.houseNo||"",landmark:E.landmark||"",locality:(null===(a=E.locality)||void 0===a?void 0:a.code)||E.locality||"",localityCode:E.localityCode||(null===(l=E.locality)||void 0===l?void 0:l.code)||"",pincode:E.pincode||"",streetName:E.streetName||""},C={tenantId:y,applicationDate:_,bookingStatus:"BOOKING_CREATED",address:A,applicantDetail:{applicantName:((null==i||null===(s=i.ownerDetails)||void 0===s?void 0:s.firstName)||"")+" "+((null==i||null===(u=i.ownerDetails)||void 0===u?void 0:u.lastName)||""),applicantEmailId:(null==i||null===(d=i.ownerDetails)||void 0===d?void 0:d.emailId)||"",applicantMobileNo:(null==i||null===(p=i.ownerDetails)||void 0===p?void 0:p.mobileNumber)||"",selfDeclaration:(null==i||null===(h=i.ownerDetails)||void 0===h?void 0:h.selfDeclaration)||!0,applicantDetailId:"",SGST:(null==i||null===(g=i.ownerDetails)||void 0===g?void 0:g.SGST)||""}||{},additional_details:"geolocation , siteName, SGST, selfDeclaration , endDate ,",cartDetails:b.map(e=>{var t,n,r,o,i;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType,bookingDate:e.startDate,endDate:e.endDate,bookingFromTime:e.bookingFromTime,bookingToTime:e.bookingToTime,advertisementId:e.siteId||"",cartId:e.siteId||"",cartAddress:e.cartAddress||"",geoLocation:(null===(n=e.geoLocation)||void 0===n?void 0:n.code)||e.geoLocation,faceArea:(null===(r=e.size)||void 0===r?void 0:r.code)||e.size,location:(null===(o=e.siteName)||void 0===o?void 0:o.code)||e.siteName||"",status:"BOOKING_CREATED",availabilityStatus:(null===(i=e.availabilityStatus)||void 0===i?void 0:i.code)||e.availabilityStatus||"",rate:e.rate||""}}),documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}};D(Jr("applicantDetail",C.applicantDetail)),D(Jr("cartDetails",C.cartDetails)),D(Jr("cartAddress",e.cartAddress)),D(Jr("siteDetails",e)),D(Jr("siteId",e.siteId)),D(Jr("siteName",e.siteName)),D(Jr("bookingFromTime",e.bookingFromTime)),D(Jr("bookingToTime",e.bookingToTime));const T={draft:!0,bookingApplication:C},w=tt(function(){return Promise.resolve(Digit.ADSServices.create({bookingApplication:C},y)).then(function(e){var t;const n=null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status;if("string"==typeof n&&"successful"===n.toLowerCase()){const t=Array.isArray(null==e?void 0:e.bookingApplication)?e.bookingApplication[0]:null==e?void 0:e.bookingApplication;D(Jr("CreatedResponse",t||e)),N([]),I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),o(e)}else console.error("ADS create failed:",e),D(Jr("CreatedResponse",{draft:!0,bookingApplication:C})),o(c({},T,{draft:!0}))})},function(e){console.error("ADS create error:",e),D(Jr("CreatedResponse",{draft:!0,bookingApplication:C})),o(c({},T,{draft:!0}))});return Promise.resolve(w&&w.then?w.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",null,r.createElement(t.CardLabel,null,"Enter site id ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"siteId",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteId&&r.createElement("p",{style:{color:"red"}},b.siteId.message),r.createElement(t.CardLabel,null,"Site Name ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"siteName",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{className:"form-field",select:t=>{e.onChange(t),t&&t.geo_tag&&t.geo_tag.latitude&&t.geo_tag.longitude&&(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!0,shouldDirty:!0}),T(t.name),E("cartAddress")||y("cartAddress",t.name))},onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteName&&r.createElement("p",{style:{color:"red"}},b.siteName.message),r.createElement(t.CardLabel,null,"Geo Location ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"geoLocation",rules:{required:"This field is required",validate:e=>e&&(e.latitude||e.lat)&&(e.longitude||e.lng)||"Please pick a location"},render:e=>r.createElement(lt,{value:e.value,onChange:t=>{e.onChange(t),T((null==t?void 0:t.formattedAddress)||"")},onBlur:e.onBlur,t:l})}),b.geoLocation&&r.createElement("p",{style:{color:"red"}},b.geoLocation.message),r.createElement(t.CardLabel,null,"Address ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"cartAddress",rules:{required:"This field is required",pattern:{value:/^(?=.*[a-zA-Z]).*$/,message:"Enter valid address , atleast one letter must be present"},maxLength:{value:500,message:"Maximum 500 characters"},minLength:{value:5,message:"Minimum 5 characters"}},render:e=>r.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.cartAddress&&r.createElement("p",{style:{color:"red"}},b.cartAddress.message),r.createElement(t.CardLabel,null,"Size ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"height",rules:{required:"Height is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"height"})}}),b.height&&r.createElement("p",{style:{color:"red"}},b.height.message),r.createElement(a.Controller,{control:h,name:"width",rules:{required:"Width is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"width"})}}),b.width&&r.createElement("p",{style:{color:"red"}},b.width.message),r.createElement(t.CardLabel,null,"Advertisement Type ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"advertisementType",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:d,optionKey:"adType"})}),b.advertisementType&&r.createElement("p",{style:{color:"red"}},b.advertisementType.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Rate / Price of the site (₹) ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"rate",rules:{pattern:{value:/^(?!.*[eE])[0-9]+(\.[0-9]{1,2})?$/,message:"Enter a valid amount"},maxLength:{value:12,message:"Maximum 12 characters"},required:"This field is required"},render:e=>r.createElement(t.TextInput,{type:"number",step:"0.01",min:"0",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t)})}),b.rate&&r.createElement("p",{style:{color:"red"}},b.rate.message),r.createElement(t.CardLabel,null,"Availability Status ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"availabilityStatus",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:co,optionKey:"i18nKey"})}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.availabilityStatus.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"GST Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"gstApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"gstApplicable"}),r.createElement("label",{htmlFor:"gstApplicable",style:{marginLeft:8}},"Yes"))}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.gstApplicable.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Cow Cess Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"cowCessApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"cowCessApplicable"}),r.createElement("label",{htmlFor:"cowCessApplicable",style:{marginLeft:8}},"Yes"))}),b.cowCessApplicable&&r.createElement("p",{style:{color:"red"}},b.cowCessApplicable.message)),r.createElement("div",{style:{margin:"12px 0"}},r.createElement("button",{type:"button",onClick:L,style:{background:"#f1f1f1",border:"1px solid #ccc",padding:"8px 12px",borderRadius:4,cursor:"pointer"}},null!==w?l?l("Save Site"):"Save Site":l?l("Add Site"):"Add Site")),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))},fo=[{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:1,body:[{route:"documents",component:"ADSSiteInspection",withoutLabel:!0,key:"documents",type:"component",nextStep:"null"}]}],mo=(window.location.href.includes("employee"),[{head:"ES_TITILE_DOCUMENT_DETAILS",stepLabel:"ES_TITILE_SITE_INSPECTION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteInspectionStepperFormOne",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]);function vo(e){var o;let{t:i,document:a,setDocuments:l,setError:s,documents:u,action:d,formData:p,handleSubmit:f,id:m}=e;const v=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[h,g]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?c({},v,{active:!0===(null==a?void 0:a.active),code:null==v?void 0:v.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[_,A]=n.useState(()=>(null==v?void 0:v.fileName)||null),{dropdownData:D}=a;var C=D;const[T,x]=n.useState(!1);T&&A(null);const[N,w]=n.useState(!1),I=["image/jpeg","image/png","application/pdf"],L=[".jpeg",".jpg",".png",".pdf"];return n.useEffect(()=>{null!=h&&h.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==S?void 0:S.length)||null===S?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S))||[],{documentType:null==h?void 0:h.code,fileStoreId:S,documentDetailId:S,fileName:_||(null==v?void 0:v.fileName)||null,mimeType:(null==y?void 0:y.type)||null,size:(null==y?void 0:y.size)||null}]})},[S,_,h]),n.useEffect(()=>{(null==u?void 0:u.length)>0&&f()},[u]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],r=null==C?void 0:C.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(g(r),b(null==n?void 0:n.fileStoreId),A((null==n?void 0:n.fileName)||null)):x(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||g({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{s(null),function(){if(y){if(w(!0),!(y.type&&I.includes(y.type)||L.some(e=>{var t;return null===(t=y.name)||void 0===t?void 0:t.toLowerCase().endsWith(e)})))return w(!1),b(null),void s(i("CS_FILE_TYPE_NOT_ALLOWED")||"Only PDF, JPG, JPEG, and PNG files are allowed.");if(y.size>=5242880)return w(!1),b(null),void s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));const e=tt(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),s(i("CS_FILE_UPLOAD_ERROR"))});e&&e.then&&e.then(function(){})}}()}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{T&&b(null)},[T]),r.createElement("div",{style:{marginBottom:"24px"}},N&&r.createElement(t.Loader,null),(null==a?void 0:a.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *")),r.createElement(t.Dropdown,{className:"form-field",selected:h,style:{width:"100%"},option:C.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>g(e),optionKey:"i18nKey",t:i})),!(null!=a&&a.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *"))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];E(n),A((null==n?void 0:n.name)||null)},onDelete:()=>{b(null),A(null),s&&s(null)},id:m,message:S?""+(_||(null==v?void 0:v.fileName)||"1 "+i("CS_ACTION_FILEUPLOADED")):i("CS_ACTION_NO_FILEUPLOADED")+" ("+(i("CS_ALLOWED_TYPES")||"PDF, JPG, JPEG, PNG")+"; ≤ 5MB)",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function ho(e){let{t:o,document:i,setDocuments:a,documents:l,validateFile:s,makeDocumentsValidator:u,mdms:c,setFormErrors:d}=e;const[p,f]=n.useState(null),[m,v]=n.useState((null==i?void 0:i.fileStoreId)||null),[h,g]=n.useState(null),[y,E]=n.useState(!1),S=window.location.href.includes("citizen");n.useEffect(()=>{p&&function(){try{E(!0);const e=tt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",p,Digit.ULBService.getStateId())).then(function(e){var t,n;if(E(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var r,i;const t=null==e||null===(r=e.data)||void 0===r||null===(i=r.files[0])||void 0===i?void 0:i.fileStoreId;v(t),b(t)}else g(o("CS_FILE_UPLOAD_ERROR")),b(null)})},function(){E(!1),g(o("CS_FILE_UPLOAD_ERROR")),b(null)});e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]);const b=e=>{const t=[...null==l?void 0:l.filter(e=>(null==e?void 0:e.documentType)!==(null==i?void 0:i.code)),...e?[{documentType:null==i?void 0:i.code,fileStoreId:e,documentUid:e}]:[]];if(!L.isEqual(t,l)){a(t);const e=u(c)(t);d(e)}};return r.createElement("div",{style:{marginBottom:"24px"}},y&&r.createElement(t.Loader,null),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}},o(null==i?void 0:i.code.replaceAll(".","_"))+(null!=i&&i.required?" *":""))),r.createElement(t.LabelFieldPair,null,r.createElement("div",{className:"field",style:{width:"100%",maxWidth:!S&&"500px"}},r.createElement(t.UploadFile,{onUpload:function(e){const t=e.target.files&&e.target.files[0];if(!t)return;const n=s(t,null==i?void 0:i.code);if(n)return g(o(n)),void b(null);g(null),f(t)},onDelete:()=>{v(null),g(null),b(null)},message:m?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:"OWNER.OWNERPHOTO"===(null==i?void 0:i.code)||"PET.PETPHOTO"===(null==i?void 0:i.code)?".jpeg, .jpg, .png":".pdf, .jpeg, .jpg, .png",buttonType:"button",error:Boolean(h)}),h&&r.createElement("div",{style:{color:"#d4351c",fontSize:"12px",marginTop:"4px",marginBottom:"10px"}},h))))}const go={step:1,isValid:!1,formData:{}},yo=function(e,t){switch(void 0===e&&(e=go),t.type){case"UPDATE_ADSNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_ADSNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_ADS_NEW_APPLICATION_FORM":return go;default:return e}},Eo={ADSCreate:e=>{var n,a,s,u;const d=l.useQueryClient(),p=i.useRouteMatch(),{t:f}=o.useTranslation(),{pathname:m}=i.useLocation(),v=i.useHistory(),h=Digit.ULBService.getStateId();let g=[];const[y,E,S]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:b,isLoading:_}=Digit.Hooks.ads.useMDMS(h,"PropertyTax","CommonFieldsConfig");function A(e,t,n,r,o){if(void 0===o&&(o=!1),"owners"===e){let n=y.owners||[];n[r]=t,E(c({},y,{[e]:[...n]}))}else if("units"===e){let e=y.units||[];e=t,E(c({},y,{units:e}))}else E(c({},y,{[e]:c({},y[e],t)}));((e,t,n,r)=>{let o,i=m.split("/").pop(),a=i.charAt(i.length-1),l=!1;Number(parseInt(i))||"0"==i||"-1"==i?"-1"==i||"-2"==i?(i=m.slice(0,-3),i=i.split("/").pop(),l=!0):(i=m.slice(0,-2),i=i.split("/").pop(),l=!0):l=!1,isNaN(a)||(l=!0);let{nextStep:s={}}=g.find(e=>e.route===(i||"0")),u=v.push;if(e&&(u=v.replace),n&&(s=r),null===s)return u(p.path+"/check");o=isNaN(s.split("/").pop())&&l&&"map"!==s?p.path+"/"+s+"/"+t:p.path+"/"+s,u(o)})(n,r,o,e)}const D=()=>{},C=()=>{};if(_)return r.createElement(t.Loader,null);b=M,b.forEach(e=>{g=g.concat(e.body.filter(e=>!e.hideInCitizen))}),g.indexRoute="searchads";const T=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ADSCheckPage"),x=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSAcknowledgement");return r.createElement(i.Switch,null,g.map((e,t)=>{const{component:n,texts:o,inputs:a,key:l}=e,s="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return r.createElement(i.Route,{path:p.path+"/"+e.route,key:t},r.createElement(s,{config:{texts:o,inputs:a,key:l},onSelect:A,onSkip:D,t:f,formData:y,onAdd:C}))}),r.createElement(i.Route,{path:p.path+"/check"},r.createElement(T,{onSubmit:function(){try{return v.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),r.createElement(i.Route,{path:p.path+"/acknowledgement"},r.createElement(x,{data:y,onSuccess:()=>{S(),d.invalidateQueries("ADS_CREATE")}})),r.createElement(i.Route,null,r.createElement(i.Redirect,{to:p.path+"/"+g.indexRoute})))},ADSSearch:e=>{var o,l;let{t:s,onSelect:u,config:d,userType:p,formData:f}=e;i.useLocation();const m=Digit.UserService.getUser().info,[v,h]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].cartDetails||(null==f||null===(o=f.adslist)||void 0===o?void 0:o.cartDetails)||[]),[g,y]=n.useState(null==f?void 0:f.adType),[E,S]=n.useState(null==f?void 0:f.location),[b,_]=n.useState(null==f?void 0:f.faceArea),[A,D]=n.useState(!0),[C,T]=n.useState(null==f?void 0:f.fromDate),[x,N]=n.useState([]),[w,I]=n.useState(null==f?void 0:f.toDate),[L,k]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].Searchdata||(null==f||null===(l=f.adslist)||void 0===l?void 0:l.Searchdata)||[]),[O,R]=n.useState(null),[P,M]=n.useState(!1),[B,F]=n.useState(""),[j,H]=n.useState((null==f?void 0:f.nightLight)||{i18nKey:"Yes",code:"Yes",value:"true"}),U=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[z,W]=n.useState(!1);let q=[],V=[],G=[];const{data:K}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"AdType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.AdType.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:Y}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"Location"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.Location.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:$}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:X}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"CalculationType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.CalculationType}});K&&K.map(e=>{q.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Y&&Y.map(e=>{V.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),$&&$.map(e=>{G.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const Z=Digit.Hooks.ads.useADSSlotSearch();let J={advertisementSlotSearchCriteria:[{bookingId:"",addType:L.addType,bookingStartDate:L.bookingStartDate,bookingEndDate:L.bookingEndDate,faceArea:L.faceArea,tenantId:U,location:L.location,nightLight:L.nightLight,isTimerRequired:!1}]};n.useEffect(()=>{var e;if(Z.data&&null!==(e=Z.data)&&void 0!==e&&e.advertisementSlotAvailabiltityDetails){var t;const e=null===(t=Z.data)||void 0===t?void 0:t.advertisementSlotAvailabiltityDetails.map((e,t)=>({slotId:t+1,addType:""+s(e.addType),addTypeCode:e.addType,faceAreaCode:e.faceArea,faceArea:""+s(e.faceArea),locationCode:e.location,location:""+s(e.location),nightLight:!1===e.nightLight?"No":"Yes",bookingDate:e.bookingDate,price:L.unitPrice,status:"AVAILABLE"===e.slotStaus?r.createElement("div",{className:"sla-cell-success"},"Available"):r.createElement("div",{className:"sla-cell-error"},"Booked")}));ee(t=>JSON.stringify(t)!==JSON.stringify(e)?e:t),ne(e=>e||!0)}},[Z.data,L]);const[Q,ee]=n.useState(""),[te,ne]=n.useState(!1),re=[{Header:""+s("ADS_TYPE"),accessor:"addType"},{Header:""+s("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+s("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+s("ADS_DATE"),accessor:"bookingDate"},{Header:""+s("ADS_STATUS"),accessor:"status"}],{control:oe}=a.useForm(),ie=()=>{let e,t=f.adslist&&f.adslist[0];"citizen"===p?(e=c({},t,{Searchdata:L,cartDetails:v,adsType:g,selectedLocation:E,selectedFace:b,selectNight:j,fromDate:C,toDate:w,existingDataSet:B}),u(d.key,c({},f[d.key],e),!1,0)):(e=c({},t,{Searchdata:L,cartDetails:v,adsType:g,selectNight:j,selectedLocation:E,selectedFace:b,fromDate:C,toDate:w,existingDataSet:B}),u(d.key,e,!1,0))};n.useEffect(()=>{"citizen"===p&&ie()},[v,g,j,b,E,L]);const ae=[{id:"selection",Header:e=>r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:x.length===Q.length,onChange:()=>{if(x.length===Q.length)N([]);else{const e=Q.filter(e=>"Available"===e.status.props.children).map(e=>e.slotId);N(e)}}})),Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:x.includes(t.original.slotId),onChange:()=>(e=>{const t=Q[e].slotId;N(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])})(t.index),disabled:"Available"!==t.original.status.props.children}))}},...re];return n.useEffect(()=>{if(null!=f&&f.adType&&null!=f&&f.faceArea&&null!=f&&f.fromDate&&null!=f&&f.toDate&&null!=f&&f.nightLight&&null!=f&&f.location&&X){var e,t,n,r,o;let s,u=null==f||null===(e=f.location)||void 0===e?void 0:e.value;const c=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===u);if(c){var i,a,l;const e="CalculationType_"+(null==f||null===(i=f.faceArea)||void 0===i?void 0:i.code);s=null==c||null===(a=c[e])||void 0===a||null===(l=a[0])||void 0===l?void 0:l.amount}const d={addType:null==f||null===(t=f.adType)||void 0===t?void 0:t.code,faceArea:null==f||null===(n=f.faceArea)||void 0===n?void 0:n.code,location:null==f||null===(r=f.location)||void 0===r?void 0:r.code,nightLight:null==f||null===(o=f.nightLight)||void 0===o?void 0:o.value,bookingStartDate:null==f?void 0:f.fromDate,bookingEndDate:null==f?void 0:f.toDate,unitPrice:s};JSON.stringify(d)!==JSON.stringify(L)&&k(d)}},[f,X]),n.useEffect(()=>{if(O){const e=setTimeout(()=>{R(null)},1500);return()=>clearTimeout(e)}},[O]),n.useEffect(()=>{L.addType&&Z.mutate(J)},[L]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen"),r.createElement(t.FormStep,{config:d,onSelect:ie,onSkip:()=>u(),t:s},r.createElement(t.CardHeader,null,s("ADS_SEARCH_HEADER")),r.createElement(t.CardLabel,null,""+s("ADS_TYPE")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"adsType",defaultValue:g,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:g,select:e=>{y(e)},placeholder:"Select Advertisement Type",option:q,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_LOCATION")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"selectedLocation",defaultValue:E,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:E,select:e=>{S(e)},placeholder:"Select Ad Type",option:V,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FACE_AREA")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"adsType",defaultValue:b,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{_(e)},placeholder:"Select Ad Type",option:G,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FROM_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"fromDate",value:C,onChange:function(e){T(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),r.createElement(t.CardLabel,null,""+s("ADS_TO_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"toDate",value:w,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),r.createElement(t.CardLabel,null,""+s("ADS_NIGHT_LIGHT")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.RadioButtons,{t:s,options:[{i18nKey:"Yes",code:"Yes",value:"true"},{i18nKey:"No",code:"No",value:"false"}],optionsKey:"code",name:"selectNight",value:j,selectedOption:j,innerStyles:{display:"inline-block",marginLeft:"10px",paddingBottom:"2px",marginBottom:"2px"},onSelect:H,isDependent:!0}),r.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"15px"}},r.createElement(t.SubmitBar,{label:s("ES_COMMON_SEARCH"),onSubmit:()=>{const e=null==g?void 0:g.code,t=C,n=w,r=null==b?void 0:b.code,o=null==E?void 0:E.value,i=null==j?void 0:j.value;let a;const l=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===o);if(l){var u,c;const e="CalculationType_"+r;a=null==l||null===(u=l[e])||void 0===u||null===(c=u[0])||void 0===c?void 0:c.amount}if(g&&t&&n&&r&&o&&i){if(new Date(t)>new Date(n))return void R({error:!0,label:s("ADS_INVALID_DATE_RANGE")});k({addType:e,faceArea:r,location:o,nightLight:i,bookingStartDate:t,bookingEndDate:n,unitPrice:a})}else R({error:!0,label:s("PLEASE_FILL_ALL_FIELDS_TO_SEARCH")})}}),r.createElement(t.SubmitBar,{label:s("ADS_ADD_TO_CART"),onSubmit:()=>{if(0===x.length)return void R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=Q.filter(e=>x.includes(e.slotId)),t=v.map(e=>({slotId:e.slotId,addType:e.addType,location:e.location,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})),n=e.map(e=>({slotId:e.slotId,addTypeCode:e.addTypeCode,faceAreaCode:e.faceAreaCode,locationCode:e.locationCode,addType:e.addType,location:e.location,faceArea:e.faceArea,price:e.price,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,status:e.status.props.children}));if(n.some(e=>t.some(t=>t.addType===e.addType&&t.location===e.location&&t.faceArea===e.faceArea&&t.nightLight===e.nightLight&&t.bookingDate===e.bookingDate)))return R({error:!0,label:s("ADS_ITEM_ALREADY_IN_CART")}),void N([]);const r={};[...t,...n].forEach(e=>{const t=e.addType+"-"+e.location+"-"+e.faceArea+"-"+e.nightLight;r[t]||(r[t]=[]),r[t].push(e)});for(let e in r){const t=r[e].sort((e,t)=>e.slotId-t.slotId);for(let e=1;e<t.length;e++)if(t[e].slotId-t[e-1].slotId>1)return R({error:!0,label:s("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void N([])}h(e=>[...e,...n]),R({success:!0,label:n.length+" item(s) added to cart."}),N([])}}),r.createElement("div",null,r.createElement(t.SubmitBar,{label:s("ADS_VIEW_CART"),onSubmit:()=>{v.length>0?W(!0):R({error:!0,label:s("ADS_NO_ITEMS_IN_CART")})}})),r.createElement("div",{class:"container",style:{width:"1px"}},r.createElement("div",{style:{width:"1px",position:"relative"}},r.createElement("div",{style:{position:"absolute",right:"83px",backgroundColor:"#FFFFFF",color:"#008000",padding:"4px",borderRadius:"30px",margin:"1px 0 1px 0",width:"31px",height:"30px",textAlign:"center",transform:"translateX(100%)"}},r.createElement("div",null," ",v.length)))),z&&r.createElement(qe,{onClose:()=>{W(!1)},cartDetails:v,setCartDetails:h}),r.createElement(t.SubmitBar,{label:s("ADS_BOOK_NOW"),onSubmit:()=>{0===v.length?R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")}):A?M(!0):ie()}}))),te&&r.createElement(t.Card,{style:{overflowX:"auto"}},r.createElement(Be,{t:s,data:Q,columns:ae,getCellProps:e=>({style:{minWidth:"140px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:Q.length,style:{width:"100%",overflowX:"auto"}})),O&&r.createElement(t.Toast,{error:O.error,warning:O.warning,label:s(O.label),onClose:()=>{R(null)}}),P&&r.createElement(Ue,{t:s,closeModal:()=>M(!1),actionCancelOnSubmit:()=>M(!1),onSubmit:()=>{ie(),M(!1)},setExistingDataSet:F,Searchdata:v}))},ADSCitizenDetails:e=>{var o,a,l,s,u,d,p,f,m,v,h,g,y,E,S;let{t:b,config:_,onSelect:A,userType:D,formData:C,value:T=C.adslist}=e;i.useLocation();let x=window.location.href.charAt(window.location.href.length-1),N={};const w=Digit.UserService.getUser().info,I=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),L=Digit.Hooks.ads.useADSCreateAPI(),[k,O]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].applicantName||(null==C||null===(o=C.applicant)||void 0===o?void 0:o.applicantName)||(null==T||null===(a=T.existingDataSet)||void 0===a||null===(l=a.applicant)||void 0===l?void 0:l.applicantName)||""),[R,P]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].emailId||(null==C||null===(s=C.applicant)||void 0===s?void 0:s.emailId)||(null==T||null===(u=T.existingDataSet)||void 0===u||null===(d=u.applicant)||void 0===d?void 0:d.emailId)||""),[M,B]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].mobileNumber||(null==T||null===(p=T.existingDataSet)||void 0===p||null===(f=p.applicant)||void 0===f?void 0:f.mobileNumber)||(null==C||null===(m=C.applicant)||void 0===m?void 0:m.mobileNumber)||(null==w?void 0:w.mobileNumber)),[F,j]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].alternateNumber||(null==C||null===(v=C.applicant)||void 0===v?void 0:v.alternateNumber)||(null==T||null===(h=T.existingDataSet)||void 0===h||null===(g=h.applicant)||void 0===g?void 0:g.alternateNumber)||""),H=()=>{let e=C.applicant&&C.applicant[x],t=null==T?void 0:T.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.light,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));L.mutate({bookingApplication:{tenantId:I,applicantDetail:{applicantName:k,applicantMobileNo:M,applicantAlternateMobileNo:F,applicantEmailId:R},cartDetails:t,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0},{onSuccess:t=>{var n;const r=null==t||null===(n=t.bookingApplication[0])||void 0===n?void 0:n.draftId;let o;"citizen"===D?(o=c({},e,{applicantName:k,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),A(_.key,c({},C[_.key],o),!1,x)):(o=c({},e,{applicantName:k,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),A(_.key,o,!1,x))}})};return n.useEffect(()=>{"citizen"===D&&H()},[]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ze,{currentStep:1}):null,r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(nt,{timerValues:null==T||null===(y=T.existingDataSet)||void 0===y||null===(E=y.timervalue)||void 0===E?void 0:E.timervalue,SlotSearchData:null==T?void 0:T.cartDetails,draftId:null==T||null===(S=T.existingDataSet)||void 0===S?void 0:S.draftId})),r.createElement(et,null))),r.createElement(t.FormStep,{config:_,onSelect:H,onSkip:()=>A(),t:b,isDisabled:!k||!M||!R},r.createElement("div",null,r.createElement(t.CardLabel,null,""+b("ADS_APPLICANT_NAME")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",placeholder:"Enter Applicant Name",value:k,onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");O(t)},style:{width:"EMPLOYEE"===w.type?"51.6%":null},ValidationRequired:!0},N={pattern:"^[a-zA-Z ]+$",type:"tel",title:b("CHB_NAME_ERROR_MESSAGE")})),r.createElement(t.CardLabel,null,""+b("ADS_MOBILE_NUMBER")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.MobileNumber,{value:M,name:"mobileNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Applicant Register Mobile Number",onChange:e=>function(e){B(e.target.value)}({target:{value:e}}),pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_ALT_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{value:F,name:"alternateNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Alternate Mobile Number",onChange:e=>function(e){j(e.target.value)}({target:{value:e}}),required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_EMAIL_ID")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:R,placeholder:"Enter Applicant Email Id",style:{width:"EMPLOYEE"===w.type?"51.6%":null},onChange:function(e){P(e.target.value)},ValidationRequired:!0},N={required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:b("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:e=>{var o;let i,{t:a,value:l={},onChange:s=(()=>{}),onBlur:u=(()=>{}),errorsP:d}=e;i="CITIZEN"===(null===(o=JSON.parse(window.localStorage.getItem("user-info")))||void 0===o?void 0:o.type)?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentPermanentCity();const[p,f]=n.useState((null==l?void 0:l.addressId)||""),[m,v]=n.useState((null==l?void 0:l.doorNo)||""),[h,g]=n.useState((null==l?void 0:l.houseNo)||""),[y,E]=n.useState((null==l?void 0:l.houseName)||""),[S,b]=n.useState((null==l?void 0:l.streetName)||""),[_,A]=n.useState((null==l?void 0:l.addressline1)||""),[D,C]=n.useState((null==l?void 0:l.addressline2)||""),[T,x]=n.useState((null==l?void 0:l.landmark)||""),[N,w]=n.useState((null==l?void 0:l.pincode)||""),[I,L]=n.useState((null==l?void 0:l.city)||""),[k,O]=n.useState((null==l?void 0:l.locality)||""),[R,P]=n.useState({});n.useEffect(()=>{f((null==l?void 0:l.addressId)||""),v((null==l?void 0:l.doorNo)||""),g((null==l?void 0:l.houseNo)||""),E((null==l?void 0:l.houseName)||""),b((null==l?void 0:l.streetName)||""),A((null==l?void 0:l.addressline1)||""),C((null==l?void 0:l.addressline2)||""),x((null==l?void 0:l.landmark)||""),w((null==l?void 0:l.pincode)||""),L((null==l?void 0:l.city)||""),O((null==l?void 0:l.locality)||"")},[l]),n.useEffect(()=>{null!=l&&l.city&&L(l.city)},[l]);const M=n.useRef(s);n.useEffect(()=>{M.current=s},[s]);const B=n.useRef(u);n.useEffect(()=>{B.current=u},[u]);const F=function(e){var t,n,r,o,i;void 0===e&&(e={});const a=null!=(t=null!=(n=e.city)?n:I)?t:(null==l?void 0:l.city)||"",s=null!=(r=null!=(o=e.locality)?o:k)?r:(null==l?void 0:l.locality)||"",u=c({addressId:p,doorNo:m,houseNo:h,houseName:y,streetName:S,addressline1:_,addressline2:D,landmark:T,pincode:N,city:a,cityCode:"object"==typeof a?a.code||a.city&&a.city.code||"":a||"",locality:s,localityCode:"object"==typeof s?s.code||s:s||""},e);null===(i=M.current)||void 0===i||i.call(M,u)},j=(e,t)=>{const n=["doorNo","addressId","addressline2"],r=(null==t?void 0:t.trim())||"";n.includes(e)||t&&""!==r?"city"===e||"locality"===e?!/^[a-zA-Z\s]{2,}$/.test(r)||r.length<2?P(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 letters and can only contain letters and spaces"})):P(t=>c({},t,{[e]:""})):n.includes(e)?P(t=>c({},t,{[e]:""})):P(r.length<2?t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 characters"}):t=>c({},t,{[e]:""})):P(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" is required"}))};n.useEffect(()=>{var e;if(null!=d&&null!==(e=d.address)&&void 0!==e&&e.message){const e=d.address.message.replace("Address missing:","").split(",").map(e=>e.trim()),t={};e.forEach(e=>{t[e]="This field is required"}),P(e=>c({},e,t))}},[d]);const H={marginTop:"-18px",color:"red"};return r.createElement("div",null,r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_ID"):"Address ID"),r.createElement(t.TextInput,{value:p,onChange:e=>{const t=e.target.value;f(t),F({addressId:t}),j("addressId",t)},onBlur:()=>B.current&&B.current()}),(R.addressId||d)&&r.createElement(t.CardLabelError,{style:H},R.addressId),r.createElement(t.CardLabel,null,a?a("ADS_DOOR_NO"):"Door No"),r.createElement(t.TextInput,{value:m,onChange:e=>{const t=e.target.value;v(t),F({doorNo:t}),j("doorNo",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.doorNo)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.doorNo),r.createElement(t.CardLabel,null,a?a("ADS_HOUSE_NO"):"House No"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:h,onChange:e=>{const t=e.target.value;g(t),F({houseNo:t}),j("houseNo",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.houseNo)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.houseNo),r.createElement(t.CardLabel,null,a?a("ADS_HOUSE_NAME"):"House Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:y,onChange:e=>{const t=e.target.value;E(t),F({houseName:t}),j("houseName",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.houseName)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.houseName),r.createElement(t.CardLabel,null,a?a("ADS_STREET_NAME"):"Street Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:S,onChange:e=>{const t=e.target.value;b(t),F({streetName:t}),j("streetName",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.streetName)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.streetName),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_LINE1"):"Address Line 1"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:_,onChange:e=>{const t=e.target.value;A(t),F({addressline1:t}),j("addressline1",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.addressline1)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.addressline1),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_LINE2"):"Address Line 2"),r.createElement(t.TextInput,{value:D,onChange:e=>{const t=e.target.value;C(t),F({addressline2:t}),j("addressline2",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.addressline2)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.addressline2),r.createElement(t.CardLabel,null,a?a("ADS_LANDMARK"):"Landmark"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextArea,{value:T,onChange:e=>{const t=e.target.value;x(t),F({landmark:t}),j("landmark",t)},onBlur:()=>B.current&&B.current(),style:{width:"50%"}}),(null==R?void 0:R.landmark)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.landmark),R.locality&&r.createElement("div",{style:{color:"red"}},R.locality),r.createElement(t.CardLabel,null,a?a("ADS_CITY"):"City"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:I,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");L(t),F({city:t}),j("city",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.city)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.city),r.createElement(t.CardLabel,null,a?a("ADS_LOCALITY"):"Locality"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:k,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");O(t),F({locality:t}),j("locality",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.locality)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.locality),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_PINCODE"):"Pincode"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:N,onChange:e=>{const t=String(e.target.value||"").replace(/\D/g,"").slice(0,6);w(t),F({pincode:t}),P(t?e=>c({},e,{pincode:""}):e=>c({},e,{pincode:"Pincode is required"}))},maxLength:6}),(null==R?void 0:R.pincode)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.pincode))},ADSWFCaption:Ke,LocationSearchCard:Me,NewSiteInspectionStepperForm:e=>{const a=mo.map(e=>c({},e,{currStepConfig:fo.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(i.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement($r,{stepsList:a,onSubmit:e=>{},step:f,setStep:e=>{u(Qr(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},NewSiteInspectionStepperFormOne:e=>{let{config:o,onGoNext:i,onBackClick:a,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.ads.useADSDocumentsMDMS(m,"Advertisements",["Documents"]),h=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:h,config:o.currStepConfig,onSubmit:function(e){var t;const n=(e=>{var t;const n=((null==e||null===(t=e.NDC)||void 0===t?void 0:t.Documents)||[]).filter(e=>null==e?void 0:e.required).map(e=>e.code);return function(e){void 0===e&&(e=[]);const t={};if(null==n||!n.length)return t;for(const o of n){var r;if(!(null===(r=e)||void 0===r?void 0:r.some(e=>{var t,n;return(null==e||null===(t=e.documentType)||void 0===t||null===(n=t.includes)||void 0===n?void 0:n.call(t,o))&&((null==e?void 0:e.filestoreId)||(null==e?void 0:e.fileStoreId))}))){t.missingRequired="ADS_MISSING_REQUIRED_DOCUMENTS";break}}return t}})(v)((null==h||null===(t=h.documents)||void 0===t?void 0:t.documents)||[]);if(null!=n&&n.missingRequired)return f("Please upload all required documents"),void d(!0);i()},onFormValueChange:function(e,t){L.isEqual(t,h)||u(Jr(o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},ADSSiteInspection:e=>{var o,i,a;let{t:l,config:s,onSelect:u,formData:d}=e;Digit.ULBService.getStateId();const[p,f]=n.useState((null==d||null===(o=d.documents)||void 0===o?void 0:o.documents)||[]),[m,v]=n.useState(null),[h,g]=n.useState(!0),[y,E]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:_}=Digit.Hooks.pt.usePropertyMDMS(S,"NDC",["Documents"]),A=()=>{let e;e=c({},d.documents,{documents:p}),u(s.key,e)};return n.useEffect(()=>{var e,t;const n=(null==_||null===(e=_.NDC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>null==e?void 0:e.required))||[],r=p||[],o=n.every(e=>r.some(t=>{var n;return(null==t||null===(n=t.documentType)||void 0===n?void 0:n.includes(e.code))&&(null==t?void 0:t.fileStoreId)}));g(!(o&&!m))},[p,_,m]),r.createElement("div",null,b?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:l,config:s,onSelect:A,onSkip:()=>u(),isDisabled:h,onAdd:function(){}},null==_||null===(i=_.NDC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>r.createElement(vo,{key:t,document:e,t:l,error:m,setError:v,setDocuments:f,documents:p,setCheckRequiredFields:E,handleSubmit:A})),m&&r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(t.Toast,{label:m,onClose:()=>v(null),error:!0}),r.createElement("button",{type:"button","aria-label":"Dismiss",onClick:()=>v(null),style:{background:"transparent",border:"none",fontSize:"18px",cursor:"pointer",lineHeight:1},title:l("CS_ACTION_CLOSE")||"Close"},"×"))))},ADSSiteMaster:po,NewSiteMasterFormStepOne:e=>{let{config:i,onGoNext:a}=e;const{t:l}=o.useTranslation(),u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement(po,{goNext:function(e){u(Jr(i.key,e)),a()},currentStepData:m,t:l}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewSiteMasterStepperForm:e=>{const a=uo.map(e=>c({},e,{currStepConfig:so.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(i.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement($r,{stepsList:a,onSubmit:e=>{},step:f,setStep:e=>{u(Qr(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},ADSWFReason:Ge,ADSWFApplicationTimeline:$e,ADSDocumentDetails:e=>{var o,i,a,l,s,u,d,p;let{t:f,config:m,onSelect:v,formData:h,value:g=h.adslist}=e;const[y,E]=n.useState((null==h||null===(o=h.documents)||void 0===o?void 0:o.documents)||(null==g||null===(i=g.existingDataSet)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.documents)||[]),[S,b]=n.useState(null),[_,A]=n.useState(!0),[D,C]=n.useState(!1),T=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),x=Digit.Hooks.ads.useADSCreateAPI(),N=Digit.ULBService.getStateId(),{isLoading:w,data:I}=Digit.Hooks.ads.useADSDocumentsMDMS(N,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==I||null===(e=I.Advertisement)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;y.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),A("0"!=t&&0!=t||!(y.length>0))},[y,D]),r.createElement("div",null,r.createElement(Ze,{currentStep:3}),r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(nt,{timerValues:null==g||null===(l=g.existingDataSet)||void 0===l||null===(s=l.timervalue)||void 0===s?void 0:s.timervalue,SlotSearchData:null==g?void 0:g.cartDetails,draftId:null==g||null===(u=g.existingDataSet)||void 0===u?void 0:u.draftId})),r.createElement(et,null))),w?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:f,config:m,onSelect:()=>{var e,t,n,r,o,i,a,l,s,u,d,p,f,E,S,b,_,A,D,C,N;let w=null==g?void 0:g.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const I={bookingApplication:{tenantId:T,draftId:null==h||null===(e=h.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==h||null===(t=h.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==h||null===(n=h.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==h||null===(r=h.applicant)||void 0===r?void 0:r.alternateNumber,applicantEmailId:null==h||null===(o=h.applicant)||void 0===o?void 0:o.emailId},addressdetails:{pincode:null==h||null===(i=h.address)||void 0===i?void 0:i.pincode,city:null==h||null===(a=h.address)||void 0===a||null===(l=a.city)||void 0===l||null===(s=l.city)||void 0===s?void 0:s.name,cityCode:null==h||null===(u=h.address)||void 0===u||null===(d=u.city)||void 0===d||null===(p=d.city)||void 0===p?void 0:p.code,locality:null==h||null===(f=h.address)||void 0===f||null===(E=f.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==h||null===(S=h.address)||void 0===S||null===(b=S.locality)||void 0===b?void 0:b.code,streetName:null==h||null===(_=h.address)||void 0===_?void 0:_.streetName,addressLine1:null==h||null===(A=h.address)||void 0===A?void 0:A.addressline1,addressLine2:null==h||null===(D=h.address)||void 0===D?void 0:D.addressline2,houseNo:null==h||null===(C=h.address)||void 0===C?void 0:C.houseNo,landmark:null==h||null===(N=h.address)||void 0===N?void 0:N.landmark},documents:y,cartDetails:w,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let L;x.mutate(I),L=c({},h.documents,{documents:y}),v(m.key,L)},onSkip:()=>v(),isDisabled:_,onAdd:function(){}},r.createElement(t.CardSubHeader,null,f("ADS_PROOF_OF_DOCUMENTS")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_SIZE")),null==I||null===(d=I.Advertisement)||void 0===d||null===(p=d.Documents)||void 0===p?void 0:p.map((e,t)=>r.createElement(rt,{key:t,document:e,t:f,error:S,setError:b,setDocuments:E,documents:y,setCheckRequiredFields:C})),S&&r.createElement(t.Toast,{label:S,onClose:()=>b(null),error:!0})))},ADSCheckPage:e=>{var a,l,s,u,d,f,m,v,h,g,y;let{onSubmit:E,value:S={}}=e;const{t:b}=o.useTranslation(),[_,A]=(i.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:D,isEditADS:C,isUpdateADS:T,documents:x,address:N}=S,w=C||T?"editbookad":"bookad",I=[{Header:""+b("ADS_TYPE"),accessor:"addType"},{Header:""+b("ADS_FACE_AREA"),accessor:"faceArea"},{Header:b("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,b(t?"Yes":"No"))}},{Header:""+b("ADS_DATE"),accessor:"bookingDate"},{Header:b("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>L(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],L=e=>{var t;const n=c({},_);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),A(n)},k=(null==_||null===(a=_.adslist)||void 0===a?void 0:a.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[O,R]=n.useState(!1);return r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ze,{currentStep:4}):null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,b("ADS_SUMMARY")),r.createElement(t.CardSubHeader,null,r.createElement(nt,{timerValues:null==_||null===(l=_.adslist)||void 0===l||null===(s=l.existingDataSet)||void 0===s||null===(u=s.timervalue)||void 0===u?void 0:u.timervalue,SlotSearchData:null==_||null===(d=_.adslist)||void 0===d?void 0:d.cartDetails,draftId:null==_||null===(f=_.adslist)||void 0===f||null===(m=f.existingDataSet)||void 0===m?void 0:m.draftId}))),r.createElement("div",null,r.createElement(t.CardText,null,b("ADS_CHECK_CHECK_YOUR_ANSWERS_TEXT")),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_APPLICANT_NAME"),text:""+b(p(null==D?void 0:D.applicantName)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_MOBILE_NUMBER"),text:""+b(p(null==D?void 0:D.mobileNumber)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_ALT_MOBILE_NUMBER"),text:""+b(p(null==D?void 0:D.alternateNumber)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_EMAIL_ID"),text:""+b(p(null==D?void 0:D.emailId)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_ADDRESS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_HOUSE_NO"),text:""+b(p(null==N?void 0:N.houseNo)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_HOUSE_NAME"),text:""+b(p(null==N?void 0:N.houseName)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_STREET_NAME"),text:""+b(p(null==N?void 0:N.streetName)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE1"),text:""+b(p(null==N?void 0:N.addressline1)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE2"),text:""+b(p(null==N?void 0:N.addressline2)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LANDMARK"),text:""+b(p(null==N?void 0:N.landmark)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_CITY"),text:""+b(p(null==N||null===(v=N.city)||void 0===v||null===(h=v.city)||void 0===h?void 0:h.name)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LOCALITY"),text:""+b(p(null==N||null===(g=N.locality)||void 0===g?void 0:g.i18nKey)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_PINCODE"),text:""+b(p(null==N?void 0:N.pincode)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_CART_DETAILS")),r.createElement(Be,{t:b,data:k,columns:I,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==_||null===(y=_.adslist)||void 0===y?void 0:y.cartDetails.length}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Card,null,x&&(null==x?void 0:x.documents.map((e,t)=>r.createElement(ot,{value:S,Code:null==e?void 0:e.documentType,index:t}))))),r.createElement(t.CheckBox,{label:b("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{R(!O)},styles:{height:"auto"}})),r.createElement(t.SubmitBar,{label:b("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:E,disabled:!O})))},ADSAcknowledgement:e=>{var n;const{state:a}=e.location,{t:l}=o.useTranslation(),s=i.useHistory(),u=null==a?void 0:a.applicationData,c=(window.localStorage.getItem("Citizen.tenant-id"),((null==s||null===(n=s.location)||void 0===n?void 0:n.pathname)||"").split("/").pop());return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:l("ADS_"+(null==u?void 0:u.applicationStatus)+"_HEADER"),applicationNumber:c,info:"REJECTED"===(null==u?void 0:u.applicationStatus)?"":l("ADS_BOOKING_NUMBER"),successful:"REJECTED"!==(null==u?void 0:u.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==u?void 0:u.applicationStatus)?r.createElement(t.CardText,null,l("ADS_"+(null==u?void 0:u.applicationStatus)+"_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{s.push("/digit-ui/citizen")}}),r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{s.push("/digit-ui/citizen/ads-home")}}),"PENDINGPAYMENT"===(null==u?void 0:u.applicationStatus)&&r.createElement(t.SubmitBar,{label:l("COMMON_MAKE_PAYMENT"),onSubmit:()=>{s.push("/digit-ui/citizen/payment/my-bills/ADV/"+c)}}))))},ADSAddressField:lt,ADSCard:at,ADSMyApplications:()=>{const{t:e}=o.useTranslation(),a=Digit.UserService.getUser().info,[l,s]=n.useState(null);let u,d=window.location.href.split("/").pop();isNaN(parseInt(d))||(u=d);let p=isNaN(parseInt(d))?{limit:"200",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:"pb.testing",mobileNumber:null==a?void 0:a.mobileNumber}:{limit:"250",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:"pb.testing",mobileNumber:null==a?void 0:a.mobileNumber};n.useEffect(()=>{s(p)},[d]);const{isLoading:f,data:m,refetch:v}=Digit.Hooks.ads.useADSSearch({filters:l}),h=(null==m?void 0:m.bookingApplication)||[];n.useEffect(()=>{v()},[]);const[g,y]=n.useState(1),[E,S]=n.useState(!1),b=5*g,_=b-5,A=(null==h?void 0:h.slice(_,b))||[],D=Math.ceil(((null==h?void 0:h.length)||0)/5),C={paginationControls:{display:"flex",justifyContent:"center",alignItems:"center",gap:"12px",margin:"20px 0"},paginationBtn:{backgroundColor:"#2947a3",color:"#fff",border:"none",padding:"8px 12px",borderRadius:"50%",fontSize:"18px",cursor:"pointer",transition:"background-color 0.2s ease"},disabledBtn:{backgroundColor:"#ccc",cursor:"not-allowed"},paginationInfo:{fontWeight:500,color:"#333"}};return f?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement(t.Header,null,e("ADS_MY_BOOKINGS_HEADER")+" "+(h?"("+h.length+")":"")),r.createElement("div",null,(null==A?void 0:A.length)>0&&A.map((t,n)=>r.createElement("div",{key:n},r.createElement(At,{application:t,tenantId:"pb.testing",buttonLabel:e("ADS_SUMMARY")}))),!(null!=h&&h.length)>0&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),(null==h?void 0:h.length)>5&&r.createElement("div",{style:C.paginationControls},r.createElement("button",{style:c({},C.paginationBtn,1===g?C.disabledBtn:{}),disabled:1===g,onClick:()=>{S(!0),setTimeout(()=>{y(e=>e-1),S(!1)},500)}},"←"),r.createElement("span",{style:C.paginationInfo},_+1+"-"+Math.min(b,h.length)+" of "+h.length),r.createElement("button",{style:c({},C.paginationBtn,g===D?C.disabledBtn:{}),disabled:g===D,onClick:()=>{S(!0),setTimeout(()=>{y(e=>e+1),S(!1)},500)}},"→"))),r.createElement("div",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION")," ",r.createElement(i.Link,{to:"/digit-ui/citizen/ads/bookad/searchads"},r.createElement("button",{style:{padding:"8px opx",fontWeight:"700",display:"block"}},e("ADS_NEW_BOOKING")+" +"))))},ApplicationDetails:()=>{var e,a,l,s,u,p,f,m,y,E,S,b,_,A,D,C,T,x,N;const{id:w}=i.useParams(),{t:I}=o.useTranslation(),L=i.useHistory(),k=Digit.ULBService.getCurrentTenantId(),[O,R]=n.useState({}),P=null==k?void 0:k.split(".")[0],[M,B]=n.useState(null),[F,j]=n.useState(null),[H,U]=n.useState({}),z=Array.isArray(null==H?void 0:H.Documents)?H.Documents:Array.isArray(null==H?void 0:H.documents)?H.documents:[],[W,q]=n.useState({}),[V,G]=n.useState(!1),[K,Y]=n.useState(!1);n.useEffect(()=>{var e,t,n;const r=(z||[]).map(e=>{var t;return e?e.fileStoreId?e.fileStoreId:e.fileStoreIds&&Array.isArray(e.fileStoreIds)?e.fileStoreIds[0]:e.fileId?e.fileId:e.documentDetailId?e.documentDetailId:null!=e&&null!==(t=e.file)&&void 0!==t&&t.fileStoreId?e.file.fileStoreId:null:null}).filter(Boolean);if(null==r||!r.length)return void G(!1);G(!0);const o=(null===(e=Digit)||void 0===e||null===(t=e.ULBService)||void 0===t||null===(n=t.getStateId)||void 0===n?void 0:n.call(t))||null;Digit.UploadServices.Filefetch(r,o||k).then(e=>{var t,n;let r=null!=(t=null!=(n=null==e?void 0:e.data)?n:null==e?void 0:e.files)?t:e;if(Array.isArray(r)){const e={};r.forEach(t=>{if(!t)return;if("string"==typeof t)return;const n=t.fileStoreId||t.fileId||t.documentDetailId,r=t.url||t.fileUrl||("string"==typeof t?t:null);n&&r&&(e[n]=r)}),r=e}q(r||{})}).catch(e=>{console.error("Filefetch error:",e),q({})}).finally(()=>G(!1))},[JSON.stringify(z)]);const{isLoading:$,data:X,refetch:Z}=Digit.Hooks.ads.useADSSearch({tenantId:k,filters:{bookingNo:w}}),J=null!=(e=null==X||null===(a=X.bookingApplication)||void 0===a?void 0:a[0])?e:[],Q=J,ee=Q||J||O||null,te=v(X),ne=n.useRef(),[re,oe]=n.useState(!1),[ie,ae]=n.useState(null),[le,se]=n.useState(!1),[ue,ce]=n.useState(!1),{data:de,isLoading:pe}=(null===(l=Digit.Hooks.ads)||void 0===l||null===(s=l.useADSCreateAPI)||void 0===s||s.call(l,k,!1),Digit.Hooks.useRecieptSearch({tenantId:k,businessService:"adv-services",consumerCodes:(null==H||null===(u=H.applicantData)||void 0===u?void 0:u.applicationNo)||w,isEmployee:!1},{enabled:!!(null!=H&&null!==(p=H.applicantData)&&void 0!==p&&p.applicationNo||w)}));Digit.Hooks.useClickOutside(ne,()=>{oe(!1)},re);const fe=Digit.Hooks.useWorkflowDetails({tenantId:k,id:null==Q?void 0:Q.bookingNo,moduleCode:"advandhoarding"}),me=(null==fe||null===(f=fe.data)||void 0===f||null===(m=f.nextActions)||void 0===m?void 0:m.map(e=>({action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase()})))||[];n.useEffect(()=>{if(Q){var e,t,n,r,o;const i={applicationNo:null==Q?void 0:Q.bookingNo,name:null==Q||null===(e=Q.applicantDetail)||void 0===e?void 0:e.applicantName,email:null==Q||null===(t=Q.applicantDetail)||void 0===t?void 0:t.applicantEmailId,mobile:null==Q||null===(n=Q.applicantDetail)||void 0===n?void 0:n.applicantMobileNo,address:null==Q||null===(r=Q.address)||void 0===r?void 0:r.addressLine1,pincode:null==Q||null===(o=Q.address)||void 0===o?void 0:o.pincode,bookingStatus:null==Q?void 0:Q.bookingStatus,paymentDate:null!=Q&&Q.paymentDate?new Date(Q.paymentDate).toLocaleDateString():"",receiptNo:null==Q?void 0:Q.receiptNo,auditDetails:null==Q?void 0:Q.auditDetails},a=(e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))})((null==Q?void 0:Q.documents)||[]);U({applicantData:i,Documents:a})}else U({})},[Q]),n.useEffect(()=>{Y($||!Q),R(Q?c({},Q,{applicationDetails:[{title:"ADS_DETAILS_SUMMARY_LABEL"}]}):{})},[$,Q]);const ve=function(e){try{var t,n,r,o,i,a,l;const s=null!=(t=null!=(n=null!=(r=null==X||null===(o=X.Applications)||void 0===o?void 0:o[0])?r:null==X||null===(i=X.data)||void 0===i?void 0:i[0])?n:null==X?void 0:X[0])?t:Q;if(!s)return B({key:"error",message:"Application data not loaded. Try reloading the page."}),j("Application data not loaded"),Promise.resolve();const u=(null==e||null===(a=e.Licenses)||void 0===a?void 0:a[0])||e;if(!u||!u.action)return B({key:"error",message:"No workflow action provided"}),j("No workflow action provided"),Promise.resolve();const d=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==u?void 0:u.assignee)||(null==u?void 0:u.assignees)||(null==u?void 0:u.assigneeUuid)),p=(null==fe||null===(l=fe.data)||void 0===l?void 0:l.applicationBusinessService)||"ADV",f=c({tenantId:k},s,{documents:(null==s?void 0:s.documents)||(null==s?void 0:s.Documents)||[],workflow:c({businessService:p,action:u.action,comments:u.comment||u.action||"",documents:null!=u&&u.wfDocuments?null==u?void 0:u.wfDocuments:null},d?{assignes:d}:{})});return null!=u&&u.assignee||"FORWARD"!==u.action?Promise.resolve(tt(function(){var e;if(null===(e=Digit)||void 0===e||!e.ADSServices||"function"!=typeof Digit.ADSServices.update)throw new Error("Digit.ADSServices.update is not available in this runtime");return Promise.resolve(Digit.ADSServices.update({bookingApplication:f},k)).then(function(e){var t,n;"SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)?(B({key:"success",message:"Successfully updated the status"}),j("Successfully updated the status"),null==fe||null===(n=fe.revalidate)||void 0===n||n.call(fe),setTimeout(()=>{L.push("/digit-ui/employee/ads/inbox")},1200),ae(null),se(!1)):(B({key:"error",message:(null==I?void 0:I("SOMETHING_WENT_WRONG"))||"Failed to update"}),j("Failed to update"))})},function(e){console.error("submitAction error:",e),B({key:"error",message:"Something went wrong"}),j("Something went wrong")})):(B({key:"error",message:"Assignee is mandatory"}),j("Assignee is mandatory"),Promise.resolve())}catch(e){return Promise.reject(e)}};let he=[];he.push({label:I("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(e){try{try{if(!e)throw new Error("Booking Application data is missing");Tr(e,I),B({key:"success",message:I("ADV_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY")}),j("Acknowledgement Downloaded Successfully")}catch(e){console.error("Acknowledgement download error:",e),B({key:"error",message:""+e.message}),j("Something Went Wrong")}return Promise.resolve()}catch(e){return Promise.reject(e)}}(ee)}),de&&(null==de||null===(y=de.Payments)||void 0===y?void 0:y.length)>0&&!1===pe&&(he.push({label:I("CHB_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,Kr);try{return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,te)]},"adv-bill")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==de||null===(e=de.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==de?void 0:de.Payments[0]})}}),de&&(null==de?void 0:de.Payments.length)>0&&!pe&&he.push({label:I("CHB_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,Gr);try{function r(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let e=te,o=null==e?void 0:e.permissionLetterFilestoreId;const i=function(){if(!o)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,e)]},"adv-permissionletter")).then(function(e){o=null==e?void 0:e.filestoreIds[0],Z()})}();return Promise.resolve(i&&i.then?i.then(r):r())}catch(e){return Promise.reject(e)}}({tenantId:null==de||null===(e=de.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==de?void 0:de.Payments[0]})}}));const ge=h(null==Q?void 0:Q.cartDetails),[ye,Ee]=n.useState(!1);return $||K?r.createElement(t.Loader,null):r.createElement("div",{className:"employee-main-application-details"},r.createElement("div",{style:{marginBottom:"15px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},I("ADS_APP_OVER_VIEW_HEADER")))),r.createElement(t.Card,null,(null==H||null===(E=H.applicantData)||void 0===E||null===(S=E.auditDetails)||void 0===S?void 0:S.createdTime)&&"PENDING_FOR_PAYMENT"===(null==H||null===(b=H.applicantData)||void 0===b?void 0:b.bookingStatus)&&r.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},r.createElement(_t,{t:I,createTime:null==H||null===(_=H.applicantData)||void 0===_||null===(A=_.auditDetails)||void 0===A?void 0:A.createdTime,onExpire:e=>Ee(e)})),r.createElement(t.CardSubHeader,null,I("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,(null==H?void 0:H.applicantData)&&Object.entries(null==H?void 0:H.applicantData).filter(e=>{let[t,n]=e;return!(null==n||"string"==typeof n&&""===n.trim()||Array.isArray(n)&&0===n.length||"object"==typeof n&&!Array.isArray(n)&&0===Object.keys(n).length)}).filter(e=>{let[t]=e;return!["auditDetails","paymentDate"].includes(t)}).map(e=>{let[n,o]=e;return r.createElement(t.Row,{key:n,label:I(g(n)),text:Array.isArray(o)?o.map(e=>I("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):I("object"==typeof o?(null==o?void 0:o.code)||"N/A":o||"N/A")})}))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,I("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")),r.createElement(xr,{cartDetails:null!=ge?ge:[],t:I})),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,I("ADS_APPLICATION_DOCUMENTS_OVERVIEW")),r.createElement(n.Fragment,null,(null==ee||null===(D=ee.documents)||void 0===D?void 0:D.length)>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"30px"}},null==ee?void 0:ee.documents.map((e,t)=>r.createElement("div",{key:t},r.createElement(ot,{value:null==ee?void 0:ee.documents,Code:null==e?void 0:e.documentType,index:t}),I(null==e?void 0:e.documentType)))):r.createElement("div",{style:{padding:"0 1.5rem"}},I("TL_NO_DOCUMENTS_MSG"))),r.createElement($e,{application:ee,id:(null==H||null===(C=H.applicantData)||void 0===C?void 0:C.applicationNo)||w,userType:"employee"})),!(null!=fe&&fe.isLoading)&&Array.isArray(me)&&(null==me?void 0:me.length)>0&&r.createElement(t.ActionBar,null,re&&r.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_ADS",options:me,optionKey:"buttonLabel",t:I,onSelect:e=>{!function(e){if(e){if("PAY"===e.action){var t;const e=(null==H||null===(t=H.applicantData)||void 0===t?void 0:t.applicationNo)||w;return L.push("/digit-ui/employee/payment/collect/adv-services/"+e+"/"+k+"?tenantId="+k)}if("SUBMIT"===e.action||"INITIATE"===e.action)return ve({Licenses:[{action:e.action,comment:e.action||""}]});ae({action:e.action,comment:""}),se(!0)}}(e),oe(!1)}}),r.createElement(t.SubmitBar,{ref:ne,label:I("WF_TAKE_ACTION"),onSubmit:()=>oe(!re),disabled:ye||"BOOKING_CREATED"===(null==H||null===(T=H.applicantData)||void 0===T?void 0:T.bookingStatus)})),le?r.createElement(Or,{t:I,action:ie,tenantId:k,state:P,bookingNo:w,applicationDetails:X,applicationData:null==X?void 0:X.applicationData,closeModal:()=>{ae(null),se(!1)},submitAction:ve,actionData:(null==fe||null===(x=fe.data)||void 0===x?void 0:x.processInstances)||[],businessService:(null==fe||null===(N=fe.data)||void 0===N?void 0:N.applicationBusinessService)||"ADV",moduleCode:"advandhoarding",workflowActions:me,showToast:M,closeToast:()=>{B(null)},errors:F}):null,M&&r.createElement(t.Toast,{error:"error"===M.key,label:F,onClose:()=>B(null),isDleteBtn:!0}))},ADSApplicationDetails:()=>{var e,a,l,s,u,p,f,m,g,y;const[E,S]=n.useState([]),{t:b}=o.useTranslation(),{acknowledgementIds:_,tenantId:A}=(i.useHistory(),i.useParams()),[D,C]=n.useState(!1),[T,x]=n.useState(null),[N,w]=n.useState(!1),[I,L]=n.useState(null),[k,O]=n.useState(!1),R=n.useRef(),[P,M]=n.useState(null),{isLoading:B,error:F,data:j,refetch:H}=(Digit.Hooks.useStore.getInitData(),Digit.Hooks.ads.useADSSearch({tenantId:A,filters:{bookingNo:_}})),U=v(j);console.log("new_data my here",U),Digit.Hooks.ads.useADSCreateAPI(A,!1),n.useEffect(()=>{H()},[_,H]);const z=yn(j,"bookingApplication",[]),W=yn(j,"bookingApplication[0].bookingNo",[]);let q=z&&z.length>0&&z[0]||{};const V=q,G=Digit.Hooks.useWorkflowDetails({tenantId:A,id:_,moduleCode:"advandhoarding"}),{data:K,isLoading:Y}=Digit.Hooks.useRecieptSearch({tenantId:A,businessService:"adv-services",consumerCodes:_,isEmployee:!1},{enabled:!!_}),$=(null==G||null===(e=G.data)||void 0===e||null===(a=e.nextActions)||void 0===a?void 0:a.map(e=>c({},e,{action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase(),assignee:(null==e?void 0:e.assignee)||null,nextStateUuid:(null==e?void 0:e.nextState)||null})))||[];n.useEffect(()=>{S($)},[JSON.stringify($)]),Digit.Hooks.useClickOutside&&Digit.Hooks.useClickOutside(R,()=>{w(!1)},N);const{isLoading:X}=Digit.Hooks.ads.useADSSearch({tenantId:A,filters:{bookingNo:W,audit:!0}},{enabled:!0});let Z=[];if(Z=null!=(l=null==V?void 0:V.documents)?l:[],B||X||null!=G&&G.isLoading)return r.createElement(t.Loader,null);let J=b("CS_NA");if(null!=q&&null!==(s=q.additionalDetails)&&void 0!==s&&s.documentDate){var Q;const e=new Date(null==q||null===(Q=q.additionalDetails)||void 0===Q?void 0:Q.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];J=e.getDate()+" "+t+" "+e.getFullYear()}let ee=[];const te=h(null==q?void 0:q.cartDetails);return ee.push({label:b("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(e){try{try{if(!e)throw new Error("Booking Application data is missing");Tr(e,b),x({key:"success",message:"ADV_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY"}),M("Acknowledgment downloaded successfully")}catch(e){console.error("Acknowledgement download error:",e),x({key:"error",message:"ADV_ACKNOWLEDGEMENT_DOWNLOAD_ERROR: "+e.message}),M("Something went wrong")}return Promise.resolve()}catch(e){return Promise.reject(e)}}(V)}),K&&(null==K?void 0:K.Payments.length)>0&&!Y&&(ee.push({label:b("CHB_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,wr);try{return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,U)]},"adv-bill")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==K||null===(e=K.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==K?void 0:K.Payments[0]})}}),ee.push({label:b("CHB_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,Nr);try{function r(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let e=U,o=null==e?void 0:e.permissionLetterFilestoreId;const i=function(){if(!o)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,e)]},"adv-permissionletter")).then(function(e){o=null==e?void 0:e.filestoreIds[0]})}();return Promise.resolve(i&&i.then?i.then(r):r())}catch(e){return Promise.reject(e)}}({tenantId:null==K||null===(e=K.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==K?void 0:K.Payments[0]})}})),r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},b("ADS_BOOKING_DETAILS")),ee&&ee.length>0&&r.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>C(!D),displayOptions:D,options:ee})),r.createElement(t.Card,null,r.createElement(t.StatusTable,null),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{className:"border-none",label:b("ADS_APPLICANT_NAME"),text:(null==q||null===(u=q.applicantDetail)||void 0===u?void 0:u.applicantName)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_MOBILE_NUMBER"),text:(null==q||null===(p=q.applicantDetail)||void 0===p?void 0:p.applicantMobileNo)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_EMAIL_ID"),text:(null==q||null===(f=q.applicantDetail)||void 0===f?void 0:f.applicantEmailId)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("PTR_ADDRESS"),text:(null==q||null===(m=q.address)||void 0===m?void 0:m.addressLine1)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_ADDRESS_PINCODE"),text:(null==q||null===(g=q.address)||void 0===g?void 0:g.pincode)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_BOOKING_NO"),text:null==q?void 0:q.bookingNo}),r.createElement(t.Row,{className:"border-none",label:b("BOOKING_STATUS"),text:b(null==q?void 0:q.bookingStatus)}),(null==q?void 0:q.receiptNo)&&r.createElement(t.Row,{className:"border-none",label:b("CITIZEN_SUCCESS_ADVT_HOARDINGS_PAYMENT_RECEIPT_NO"),text:null==q?void 0:q.receiptNo})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")),r.createElement(xr,{cartDetails:null!=te?te:[],t:b}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,(null===(y=Z)||void 0===y?void 0:y.length)>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"30px"}},Z.map((e,t)=>r.createElement("div",{key:t},r.createElement(ot,{value:Z,Code:null==e?void 0:e.documentType,index:t}),b(null==e?void 0:e.documentType)))):r.createElement("div",{style:{padding:"0 1.5rem"}},b("TL_NO_DOCUMENTS_MSG"))),r.createElement($e,{application:V,id:null==q?void 0:q.bookingNo,userType:"citizen"})),T&&r.createElement(t.Toast,{error:"error"===T.key,label:P||F,onClose:()=>x(null),isDleteBtn:!0})))},ADSSearchApplication:_,ADSRequiredDoc:e=>{var n,o,i,a;let{t:l,onSelect:s,formData:u,value:c=u.adslist}=e;Digit.ULBService.getCurrentTenantId();const d=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:p,data:m={}}=Digit.Hooks.ads.useADSDocumentsMDMS(d,"Advertisement","Documents");let v=null==m||null===(n=m.Advertisement)||void 0===n?void 0:n.Documents;return r.createElement(r.Fragment,null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,l("MODULE_ADS")),r.createElement(t.CardSubHeader,null,r.createElement(nt,{timerValues:null==c||null===(o=c.existingDataSet)||void 0===o||null===(i=o.timervalue)||void 0===i?void 0:i.timervalue,SlotSearchData:null==c?void 0:c.cartDetails,draftId:null==c||null===(a=c.existingDataSet)||void 0===a?void 0:a.draftId}))),r.createElement("div",null,r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_HEADER")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_TEXT")),r.createElement(t.CardSubHeader,null,l("ADS_REQ_SCREEN_LABEL")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_LABEL_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_SIZE")),r.createElement("div",null,p&&r.createElement(t.Loader,null),Array.isArray(v)?v.map((e,n)=>{let{code:o,dropdownData:i}=e;return r.createElement("div",{key:n},r.createElement(t.CardSubHeader,null,n+1,". ",l("ADS_"+f(o,".","_"))),i.map((e,n)=>r.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",l("ADS_"+f(null==e?void 0:e.code,".","_")))))}):null)),r.createElement("span",null,r.createElement(t.SubmitBar,{label:l("ADS_COMMON_NEXT"),onSubmit:s}))))},LocationSearch:z,GIS:Ye,NewADSStepperForm:e=>{let{userType:a}=e;const l=("employee"===a?eo:to).map(e=>c({},e,{currStepConfig:("employee"===a?Xr:Zr).filter(t=>t.stepNumber===e.stepNumber)})),{t:u}=(i.useHistory(),o.useTranslation()),d=s.useDispatch(),[p,f]=n.useState(null),m=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer),v=m.formData,h=m.step;Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{d({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]);const g=null==v?void 0:v.reservationExpiry;return r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"500",color:"#1C1D1F"},divider:!0},u("ADS_REGISTRATION_APPLICATION"),g&&r.createElement(_t,{t:u,createTime:g})),r.createElement($r,{stepsList:l,onSubmit:e=>{},step:h,setStep:e=>{d(Qr(e))}}),p&&r.createElement(t.Toast,{error:p.key,label:u(p.label),onClose:()=>{f(null)},isDleteBtn:"true"}))},NewADSStepFormOne:e=>{var i,a;let{config:l,onGoNext:u,onBackClick:c}=e;const d=s.useDispatch(),{t:p}=o.useTranslation(),[f,m]=n.useState(!1),[v,h]=n.useState(""),g="undefined"!=typeof window&&(null===(i=window.location)||void 0===i||null===(a=i.href)||void 0===a?void 0:a.includes("citizen")),y=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement("div",{className:!g&&"employeeCard"},r.createElement(no,{onGoBack:function(e){c(l.key,e)},goNext:function(e){d(Jr(l.key,e)),u()},currentStepData:y,t:p})," ",f&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{m(!1),h("")}})," "))},NewADSStepFormTwo:e=>{var i,a;let{config:l,onBackClick:u,onGoNext:c}=e;const{t:d}=o.useTranslation(),p=s.useDispatch(),[f,m]=n.useState(!1),[v,h]=n.useState(""),g=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData}),y="undefined"!=typeof window&&(null===(i=window.location)||void 0===i||null===(a=i.href)||void 0===a?void 0:a.includes("citizen"));return r.createElement(r.Fragment,null,r.createElement("div",{className:!y&&"employeeCard"},r.createElement(ao,{onGoBack:function(e){u(l.key,e)},goNext:function(e){p(Jr(l.key,e)),c()},currentStepData:g,t:d}),f&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{m(!1),h("")}})))},NewADSStepFormThree:e=>{let{config:o,onGoNext:i,onBackClick:a,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{isLoading:v,data:h}=Digit.Hooks.ads.useADSDocumentsMDMS(m),g=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return n.useEffect(()=>{if(c){const e=setTimeout(()=>d(null),2e3);return()=>clearTimeout(e)}},[c]),r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:g,config:o.currStepConfig,onSubmit:function(e){const t=function(e){if(!v){var t;const n=(null==e||null===(t=e.documents)||void 0===t?void 0:t.documents)||[],r=(h||[]).filter(e=>e.required).map(e=>e.code),o=n.map(e=>e.documentType);return r.filter(e=>!o.includes(e))}}(e);if(t.length>0)return f("You haven't uploaded: "+t[0].replace(".","_").toUpperCase()),d(!0),void setTimeout(()=>{d(!1)},3e3);i()},onFormValueChange:function(e,t){L.isEqual(t,g)||u(Jr(null==o?void 0:o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewADSStepFormFour:e=>{let{config:i,onGoNext:a,onBackClick:l}=e;const u=s.useDispatch(),{t:d}=o.useTranslation(),[p,f]=n.useState(!1),[m,v]=n.useState(""),{currentStepData:h,isLoading:g}=s.useSelector(e=>{var t,n,r,o;return{currentStepData:null==e||null===(t=e.ads)||void 0===t||null===(n=t.ADSNewApplicationFormReducer)||void 0===n?void 0:n.formData,isLoading:(null===(r=e.ads.ADSNewApplicationFormReducer)||void 0===r?void 0:r.isLoading)||!(null!==(o=e.ads.ADSNewApplicationFormReducer)&&void 0!==o&&o.formData)}});return g?null:r.createElement(n.Fragment,null,r.createElement(lo,{onGoBack:e=>{const t=c({},h,{penalty:e});l(i.key,t)},goNext:e=>{const t=c({},h,{penalty:e});u(Jr(null==i?void 0:i.key,t)),a()},currentStepData:null==h?void 0:h.penalty,t:d}),p&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{f(!1),v("")}}))},NewADSStepFormFive:function(e){var o,a,l,u,d,p,f,m=e.config,v=e.onBackClick,h=e.t;const g=i.useHistory(),[y,E]=n.useState(!1),S=n.useRef(),[b,_]=n.useState([]);var A=s.useDispatch(),D=n.useState(!1),C=D[0],T=D[1];const x=window.location.href.includes("citizen"),N=x?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");var w=n.useState(""),I=w[0],k=w[1],O=s.useSelector(function(e){return e&&e.ads&&e.ads.ADSNewApplicationFormReducer&&e.ads.ADSNewApplicationFormReducer.formData||{}},L.isEqual),R=n.useRef(O);n.useEffect(function(){R.current=O},[O]);const P=(null==O?void 0:O.bookingNo)||(null==O||null===(o=O.CreatedResponse)||void 0===o?void 0:o.bookingNo)||"",M=Digit.Hooks.useWorkflowDetails({tenantId:N,id:P,moduleCode:"advandhoarding-services"});n.useEffect(()=>{var e,t;const n=null==M?void 0:M.data;if(!n)return void _(e=>e&&e.length?[]:e);const r=n.processInstances&&n.processInstances.length?n.processInstances[0]:null,o=(r&&r.nextActions||n.nextActions||[]||[]).map(e=>({action:e.action,roles:e.roles||[],assignee:e.assignee||e.assignees||e.assigner||null,nextStateUuid:e.nextState||e.nextStateUuid||null,nextState:e.nextState||e.nextStateUuid||null,buttonLabel:(e.action||"").replace(/_/g," ").toUpperCase(),comment:e.comment||e.action||"",_rawAction:e})),i=Digit.UserService.getUser();let a=(null==i||null===(e=i.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.map(e=>e.code))||[];if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){var l,s,u;const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};a=(null==t||null===(l=t.value)||void 0===l||null===(s=l.info)||void 0===s||null===(u=s.roles)||void 0===u?void 0:u.map(e=>e.code))||a}const c=o.filter(e=>!e.roles||0===e.roles.length||a.some(t=>e.roles.includes(t))).filter(e=>"SUBMIT"===e.action);_(e=>L.isEqual(e,c)?e:c)},[null==M||null===(a=M.data)||void 0===a?void 0:a.applicationBusinessService,null==M||null===(l=M.data)||void 0===l||null===(u=l.processInstances)||void 0===u?void 0:u.length]);var B=n.useRef(!0),F=n.useRef(null),j=n.useRef(null);const H=n.useCallback(function(e){void 0===e&&(e=void 0);try{var t,n,r,o,i,a,l,s,u,d;const p=null==M?void 0:M.data,f=L.merge(L.cloneDeep(R.current),e||{}),m=null!==(t=e)&&void 0!==t&&t.action?e:(null===(n=e)||void 0===n||null===(r=n.Licenses)||void 0===r?void 0:r[0])||null,v=m.nextState||m.nextStateUuid||m.status||"",y=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==m?void 0:m.assignee)||(null==m?void 0:m.assignees)||(null==m?void 0:m.assigneeUuid));if(!m||!m.action)return A(Jr("finalSubmission",f)),Promise.resolve();A(Jr("finalSubmission",f));const E=(null==p||null===(o=p.data)||void 0===o||null===(i=o.processInstances)||void 0===i||null===(a=i.state)||void 0===a?void 0:a.applicationStatus)||"",S={bookingApplication:c({tenantId:N},null==f?void 0:f.CreatedResponse,{bookingStatus:"INITIATED"===E?"BOOKING_CREATED":"REFUND"===E?"CANCELLED":E||(null==f||null===(l=f.CreatedResponse)||void 0===l?void 0:l.bookingStatus),documents:(null==f||null===(s=f.documents)||void 0===s||null===(u=s.documents)||void 0===u?void 0:u.documents)||(null==f?void 0:f.documents)||(null==f?void 0:f.Documents)||[],workflow:c({businessService:(null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService)||"ADV",states:v||E||"",action:m.action||"",comments:m.comment||m.action||"",status:E},y?{assignee:y}:{})})};if((null==m||!m.assignee)&&"FORWARD"===m.action)return k("Assignee is mandatory"),T(!0),Promise.resolve();const b=tt(function(){return Promise.resolve(Digit.ADSServices.update(S,N)).then(function(e){var t;if("SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)){var n,r,o,i,a,l,s,u,d,p,m;const e=c({},(null===(n=Digit)||void 0===n||null===(r=n.Store)||void 0===r||null===(o=r.getState)||void 0===o||null===(i=o.call(r))||void 0===i||null===(a=i.ads)||void 0===a||null===(l=a.ADSNewApplicationFormReducer)||void 0===l?void 0:l.formData)||R.current||{},f),t=Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}));A(Jr("formData",t)),g.replace(x?"/digit-ui/citizen/ads/adsservice/response/"+(null===(s=R.current)||void 0===s||null===(u=s.CreatedResponse)||void 0===u?void 0:u.bookingNo):"/digit-ui/employee/ads/adsservice/response/"+(null===(d=R.current)||void 0===d||null===(p=d.CreatedResponse)||void 0===p?void 0:p.bookingNo),{applicationData:null===(m=R.current)||void 0===m?void 0:m.CreatedResponse})}else k(h&&h("SOMETHING_WENT_WRONG")||"Failed to update"),T(!0)})},function(e){console.error("ADS update error:",e),k(h&&h("SOMETHING_WENT_WRONG")||"Failed to update"),T(!0)});return Promise.resolve(b&&b.then?b.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[N,h,A,null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService,g,x]);function U(e){v(m.key,e)}var z=n.useCallback(function(){var e=arguments.length>1?arguments[1]:void 0;B.current?B.current=!1:e&&(L.isEqual(e,R.current)||F.current&&L.isEqual(e,F.current)||(j.current&&clearTimeout(j.current),j.current=setTimeout(function(){const t=L.omitBy(L.cloneDeep(e),e=>void 0===e);if("summary"===(null==m?void 0:m.key)&&1===Object.keys(t).length&&""===t.summary)return;const n=L.merge({},R.current,t);Object.keys(t).length>0&&!L.isEqual(n,R.current)&&(F.current=n,A(Jr("formData",n)))},100)))},[A,m&&m.key]);n.useEffect(function(){return function(){j.current&&clearTimeout(j.current)}},[]);const W=r.useMemo(()=>{const e=O||{};return void 0===e.summary?c({},e,{summary:""}):e},[O]);let q=Digit.UserService.getUser();null==q||null===(p=q.info)||void 0===p||null===(f=p.roles)||void 0===f||f.map(e=>e.code);const V=r.useMemo(()=>b||[],[b]);return Digit.Hooks.useClickOutside(S,()=>{E(!1)},y),r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:W,config:m&&m.currStepConfig,onSubmit:e=>H(c({},e,{_isFormSubmit:!0})),onFormValueChange:z,label:h&&m&&m.texts?h(m.texts.submitBarLabel):"",currentStep:m&&m.currStepNumber,onBackClick:U}),C&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:I,onClose:function(){T(!1),k("")}}),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:h("CS_COMMON_BACK"),onSubmit:U,variant:"secondary"}),y&&r.createElement(t.Menu,{localeKeyPrefix:"",options:V,optionKey:"action",t:h,onSelect:e=>{!function(e){var t;if(!e)return;const n=new Set(["SUBMIT","INITIATE","PAY"]),r=e.fromStateCode||(null===(t=e._rawStateObj)||void 0===t?void 0:t.state)||null,o=e.toStateCode||null,i=n.has(e.action)?o||r||e.nextStateUuid:r||o||e.nextStateUuid;H({action:e.action,nextState:e.nextState||e.nextStateUuid||null,status:i||"",comment:e.comment||e.action||"",assignee:e.assignee||null,_rawAction:e})}(e),E(!1)}}),r.createElement(t.SubmitBar,{ref:S,label:h("WF_TAKE_ACTION"),onSubmit:()=>E(!y)})))},ADSCitizenDetailsNew:no,ADSCitizenSecond:ao,ADSSelectProofIdentity:e=>{var o;let{t:i,config:a,onSelect:l,formData:s}=e;const u=Digit.ULBService.getStateId(),[d,p]=n.useState({}),[f,m]=n.useState(null),v={maxBytes:5242880,allowedExtensions:[".pdf",".jpeg",".jpg",".png"]},h=(e,t)=>{var n,r,o;if(!e)return null;const i=v.maxBytes;let a=[...v.allowedExtensions];"OWNER.OWNERPHOTO"!==t&&"PET.PETPHOTO"!==t||(a=[".jpeg",".jpg",".png"]);const l=(null==e||null===(n=e.name)||void 0===n||null===(r=n.toLowerCase)||void 0===r?void 0:r.call(n))||"";return(null===(o=a)||void 0===o?void 0:o.some(e=>null==l?void 0:l.endsWith(e)))?(null==e?void 0:e.size)>i?"CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED":null:"CS_FILE_INVALID_TYPE"},g=e=>{var t;const n=null===(t=e||[])||void 0===t?void 0:t.filter(e=>null==e?void 0:e.required);return function(e){void 0===e&&(e=[]);const t={},r=[],o=Array.isArray(e)?e:[];if(null==n||!n.length)return t;for(const e of n)(null==o?void 0:o.some(t=>{var n;return(null===(n=t.documentType)||void 0===n?void 0:n.includes(null==e?void 0:e.code))&&((null==t?void 0:t.filestoreId)||t.fileStoreId)}))||r.push(i(null==e?void 0:e.code.replaceAll(".","_")));return(null==r?void 0:r.length)>0&&(t.missingRequired="PTR_MISSING_REQUIRED_DOCUMENTS",t.missingDocs=r),t}},{isLoading:y,data:E}=Digit.Hooks.ads.useADSDocumentsMDMS(u),[S,b]=n.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]);n.useEffect(()=>{if(E){const e=g(E)(S);p(e)}},[S,E]),n.useEffect(()=>{var e;const t=(null==s||null===(e=s.documents)||void 0===e?void 0:e.documents)||[];L.isEqual(t,S)||b(t)},[s]);const _=r.useRef();return n.useEffect(()=>{L.isEqual(_.current,S)||(_.current=S,l(a.key,{documents:S}))},[S,a.key]),n.useEffect(()=>{if(f){const e=setTimeout(()=>m(null),2e3);return()=>clearTimeout(e)}},[f]),r.createElement("div",null,y?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:i,config:a,onSelect:()=>{var e;if((null===(e=Object.keys(d))||void 0===e?void 0:e.length)>0)return m(i((null==d?void 0:d.missingRequired)||"PTR_VALIDATION_ERROR")),void l(a.key,{missingDocs:(null==d?void 0:d.missingDocs)||[]});let t=c({},E,{documents:S});l(a.key,t)},onSkip:()=>l(),isDisabled:Object.keys(d).length>0},Array.isArray(E)&&(null==E?void 0:E.map((e,t)=>{const n=null==S?void 0:S.find(t=>(null==t?void 0:t.documentType)===(null==e?void 0:e.code));return r.createElement(ho,{key:t,document:c({},e,n),t:i,setDocuments:b,documents:S,validateFile:h,makeDocumentsValidator:g,mdms:E,setFormErrors:p,formErrors:d})})),f&&r.createElement(t.Toast,{isDleteBtn:!0,label:f,onClose:()=>m(null),error:!0})))},ADSSummary:function(e){var n,o,i,a,l,u,c,d;let{t:p}=e;const f=s.useDispatch(),m=e=>p?p(e):e,v=s.useSelector(e=>{var t,n;return null==e||null===(t=e.ads)||void 0===t||null===(n=t.ADSNewApplicationFormReducer)||void 0===n?void 0:n.formData}),h=r.useMemo(()=>v||{},[v]),g=(null==h||null===(n=h.CreatedResponse)||void 0===n?void 0:n.applicantDetail)||{},y=(null==h||null===(o=h.ownerDetails)||void 0===o?void 0:o.address)||(null==h||null===(i=h.CreatedResponse)||void 0===i?void 0:i.address)||{},E=Array.isArray(null==h||null===(a=h.documents)||void 0===a||null===(l=a.documents)||void 0===l?void 0:l.documents)?null==h||null===(u=h.documents)||void 0===u||null===(c=u.documents)||void 0===c?void 0:c.documents:Array.isArray(null===(d=h.documents)||void 0===d?void 0:d.documents)?h.documents.documents:Array.isArray(h.documents)?h.documents:[],S={backgroundColor:"#ffffff",padding:"1rem 0",borderRadius:"8px",marginBottom:"1.5rem",boxShadow:"0 2px 6px rgba(18,38,63,0.04)"},b={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem",padding:"0 1.5rem"},_={fontSize:"1.25rem",color:"#0d43a7",fontWeight:"600",margin:0},A={cursor:"pointer",color:"#2e86de",fontWeight:600,fontSize:"0.9rem"},D={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e9eef2",padding:"0.6rem 1.5rem",alignItems:"center"},C={flex:"1 1 220px",minWidth:"180px",maxWidth:"260px",backgroundColor:"#fbfcfe",padding:"0.6rem",border:"1px solid #eef3f7",borderRadius:"6px"},T={fontWeight:"500",color:"#333"},x=null==h?void 0:h.ads,N=(e,n)=>r.createElement("div",{style:D},r.createElement("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"}},r.createElement(t.CardLabel,{style:T},e)),r.createElement("div",{style:{textAlign:"right",minWidth:"120px"}},n||"NA"));return r.createElement("div",{className:"application-summary"},r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:S},r.createElement("div",{style:b},r.createElement("h3",{style:_},m("ADS_APPLICANT_DETAILS")),r.createElement("span",{style:A,onClick:()=>f(Qr(2))},m("TL_SUMMARY_EDIT"))),N(m("NOC_APPLICANT_NAME_LABEL"),null==g?void 0:g.applicantName),N(m("CORE_Mobile_Number"),null==g?void 0:g.applicantMobileNo),N(m("CORE_EMAIL_ID"),null==g?void 0:g.applicantEmailId),N(m("CORE_COMMON_PINCODE"),null==y?void 0:y.pincode),N(m("ES_CREATECOMPLAINT_ADDRESS"),null==y?void 0:y.addressLine1))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:S},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem"}},r.createElement("h3",{style:_},m("ADS_DETAILS")),r.createElement("span",{style:A,onClick:()=>f(Qr(1))},m("TL_SUMMARY_EDIT"))),r.createElement(xr,{cartDetails:x,t:p}))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:S},r.createElement("div",{style:b},r.createElement("h3",{style:_},m("ADS_DOCUMENTS_DETAILS")),r.createElement("span",{style:A,onClick:()=>f(Qr(3))},m("TL_SUMMARY_EDIT"))),E.length>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem",marginTop:"0.5rem"}},E.map((e,t)=>r.createElement("div",{key:t,style:C},r.createElement(ot,{value:E,Code:null==e?void 0:e.documentType,index:t}),m(null==e?void 0:e.documentType)))):r.createElement("div",{style:{padding:"0 1.5rem"}},p("TL_NO_DOCUMENTS_MSG")))))},ADSPenalty:lo,ADSResponseCitizen:e=>{var n;const a=window.location.href.includes("citizen"),{state:l}=e.location,{t:s}=o.useTranslation(),u=i.useHistory(),c=null==l?void 0:l.applicationData,d=a?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),p=((null==u||null===(n=u.location)||void 0===n?void 0:n.pathname)||"").split("/").pop();return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:s("ADS_BOOKED_HEADER"),applicationNumber:p,info:"REJECTED"==(null==c?void 0:c.bookingStatus)?"":s("ADS_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==c?void 0:c.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==c?void 0:c.bookingStatus)?r.createElement(t.CardText,null,s("ADS_BOOKED_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{u.push(a?"/digit-ui/citizen":"/digit-ui/employee")}}),r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{u.push(a?"/digit-ui/citizen/ads-home":"/digit-ui/employee/ads/inbox")}}),r.createElement(t.SubmitBar,{label:s("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{u.push(a?"/digit-ui/citizen/payment/my-bills/adv-services/"+(null==c?void 0:c.bookingNo):"/digit-ui/employee/payment/collect/adv-services/"+p+"/"+d+"?tenantId="+d)}}))))}},So=e=>{let{stateCode:t,userType:o,tenants:a}=e;const{path:l,url:s}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"ADS",language:u}),Object.entries(Eo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("ADS_TENANTS",a),n.useEffect(()=>"employee"===o&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===o?r.createElement(bt,{path:l,url:s,userType:o}):r.createElement(T,null)},bo=e=>{const{t:i}=o.useTranslation(),[a,l,s]=Digit.Hooks.useSessionStorage("ADS",{});return n.useEffect(()=>{s()},[]),r.createElement(t.CitizenHomeCard,{header:i("ADVERTISEMENT_MODULE"),links:[],Icon:()=>r.createElement(Ve,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:So,ADSLinks:bo,ADSCard:at,ADS_INBOX_FILTER:e=>r.createElement(O,e),ADSInboxTableConfig:e=>({ADS:{inboxColumns:t=>[{Header:e("ADS_BOOKING_NO"),Cell:e=>{var n,o,a,l;let{row:s}=e;return r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(i.Link,{to:t.parentRoute+"/applicationsearch/application-details/"+(null==s||null===(n=s.original)||void 0===n||null===(o=n.searchData)||void 0===o?void 0:o.bookingNo)},null===(a=s.original)||void 0===a||null===(l=a.searchData)||void 0===l?void 0:l.bookingNo)))},mobileCell:e=>{var t;return P(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r,o,i;return R(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(r=n.original)||void 0===r||null===(o=r.searchData)||void 0===o||null===(i=o.applicantDetail)||void 0===i?void 0:i.applicantName))},mobileCell:e=>{var t,n;return P(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.applicantName)}},{Header:e("AD _TYPE"),Cell:e=>{var t,n,r,o;let{row:i}=e;return R(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(r=n.cartDetails)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.addType))},mobileCell:e=>{var t,n,r;return P(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.cartDetails)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.addType)}},{Header:e("BOOKING_STATUS"),Cell:t=>{var n,r,o,i,a;let{row:l}=t;return R(e(""+(null==l||null===(n=l.original)||void 0===n||null===(r=n.searchData)||void 0===r?void 0:r.bookingStatus)||""+(null==l||null===(o=l.original)||void 0===o||null===(i=o.workflowData)||void 0===i||null===(a=i.state)||void 0===a?void 0:a.applicationStatus)))},mobileCell:t=>{var n,r,o;return P(e("ES_ADS_COMMON_STATUS_"+((null==t||null===(n=t.searchData)||void 0===n?void 0:n.bookingStatus)||(null==t||null===(r=t.workflowData)||void 0===r||null===(o=r.state)||void 0===o?void 0:o.applicationStatus))))}},{Header:e("ADS_DATE"),Cell:e=>{var t,n;let{row:r}=e;const o=null===(t=r.original)||void 0===t||null===(n=t.searchData)||void 0===n?void 0:n.applicationDate,i=o?new Date(o).toLocaleDateString("en-GB"):"";return R(i)},mobileCell:e=>{var t;const n=null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationDate,r=n?new Date(n).toLocaleDateString("en-GB"):"";return P(r)}}],serviceRequestIdKey:t=>{var n,r;return null==t||null===(n=t[e("ADS_INBOX_UNIQUE_BOOKING_NUMBER")])||void 0===n||null===(r=n.props)||void 0===r?void 0:r.children}}})},exports.ADSLinks=bo,exports.ADSModule=So,exports.ADSReducers=()=>u.combineReducers({ADSNewApplicationFormReducer:yo});
|
|
1
|
+
var e,t=require("@mseva/digit-ui-react-components"),n=require("react"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-i18next"),i=require("react-router-dom"),a=require("react-hook-form"),l=require("react-query"),s=require("react-redux"),u=require("redux");function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function d(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"CS_NA"},f=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e};function m(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}const v=function(e){void 0===e&&(e={});const t=e||{},n=(Array.isArray(t.bookingApplication)?t.bookingApplication:[]).map(e=>{const t={};["bookingNo","paymentDate","draftId","applicationDate","tenantId","receiptNo","permissionLetterFilestoreId","paymentReceiptFilestoreId","advertisementId","bookingId","bookingStatus","auditDetails","businessService","workflow"].forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t.applicantDetail=e.applicantDetail||null,t.address=e.address||null,t.owners=e.owners||[],t.documents=e.documents||[];const n=(Array.isArray(e.cartDetails)?e.cartDetails:[]).reduce((e,t)=>{const n=(e=>(e.location||"NA")+"|"+(e.advertisementId||"NA")+"|"+(e.addType||"NA")+"|"+(e.faceArea||"NA")+"|"+(e.advertisementName||"NA")+"|"+(e.poleNo||"NA"))(t);return e[n]||(e[n]=[]),e[n].push(t),e},{}),r=Object.keys(n).map(e=>{var t,r;const o=n[e].slice().sort((e,t)=>new Date(e.bookingDate)-new Date(t.bookingDate));console.log("sorted",o);const i=[];if(o.length){let e=o[0].bookingDate||null,t=o[0].bookingDate||null;for(let n=1;n<o.length;n++){const r=new Date(t),a=new Date(o[n].bookingDate);Math.round((a-r)/864e5)<=7||(i.push([e,t]),e=o[n].bookingDate),t=o[n].bookingDate}i.push([e,t])}const a=i.map(e=>{let[t,n]=e;return t+" to "+n}).join(", "),l=(null===(t=o[0])||void 0===t?void 0:t.bookingDate)||null,s=(null===(r=o[o.length-1])||void 0===r?void 0:r.bookingDate)||null,u=o.length,c=o[0]||{},d=o.map(e=>"number"==typeof e.amount?e.amount:null);let p=void 0,f=void 0;if(d.every(e=>null!==e)){const e=d.reduce((e,t)=>e+t,0);f=e,p=o.length?Math.round(e/o.length*100)/100:0}else"number"==typeof c.amount&&(p=c.amount);return{location:c.location,advertisementId:c.advertisementId||0===c.advertisementId?""+c.advertisementId:void 0,startDate:l,endDate:s,numberOfDays:u,dateRangesFlat:a,addType:c.addType,faceArea:c.faceArea,nightLight:c.nightLight,status:c.status,advertisementName:c.advertisementName,poleNo:c.poleNo,amount:p,amountForDaysChosen:f}});return t.cartDetails=r,t});return{bookingData:[{count:n.reduce((e,t)=>e+(Array.isArray(t.cartDetails)?t.cartDetails.reduce((e,t)=>e+(t.numberOfDays||0),0):0),0),currentTime:Date.now(),bookingApplication:n}]}};function h(e){var t;const n={};return null==e||e.forEach(e=>{var t;const r=null==e?void 0:e.advertisementId;n[r]||(n[r]={ad:c({id:Number(r),name:null==e?void 0:e.advertisementName},e),slots:[]}),null===(t=n[r])||void 0===t||t.slots.push({addType:null==e?void 0:e.addType,location:null==e?void 0:e.location,faceArea:null==e?void 0:e.faceArea,nightLight:null==e?void 0:e.nightLight,bookingId:null==e?void 0:e.bookingId,timerValue:0,bookingDate:null==e?void 0:e.bookingDate,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,advertisementId:null==e?void 0:e.advertisementId,slotStaus:null==e?void 0:e.status,bookingFromTime:null==e?void 0:e.bookingFromTime,bookingToTime:null==e?void 0:e.bookingToTime,advertisementName:null==e?void 0:e.advertisementName})}),null===(t=Object.values(n))||void 0===t||t.forEach(e=>{const t=null==e?void 0:e.slots.map(e=>new Date(null==e?void 0:e.bookingDate)),n=new Date(null===Math||void 0===Math?void 0:Math.min(...t)),r=new Date(null===Math||void 0===Math?void 0:Math.max(...t)),o=e=>e.toISOString().split("T")[0];e.ad.bookingStartDate=o(n),e.ad.bookingEndDate=o(r),e.ad.startDate=o(n),e.ad.endDate=o(r)}),Object.values(n)}const g=e=>{var t,n,r,o;const i=null==e||null===(t=e.replace(/([a-z])([A-Z])/g,"$1 $2"))||void 0===t||null===(n=t.replace(/_/g," "))||void 0===n?void 0:n.replace(/([a-z])([0-9])/gi,"$1 $2");return null==i||null===(r=i.split(" "))||void 0===r||null===(o=r.map(e=>{var t;return(null==e||null===(t=e.charAt(0))||void 0===t?void 0:t.toUpperCase())+(null==e?void 0:e.slice(1))}))||void 0===o?void 0:o.join(" ")},y=e=>r.createElement("h1",{className:"heading-m"},e.t("CHB_CANCEL")),E=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(E,null)),b=e=>{let{t:o,closeModal:i,actionCancelLabel:l,actionCancelOnSubmit:s,actionSaveLabel:u,actionSaveOnSubmit:c,onSubmit:d}=e;const[p,f]=n.useState(!1),{handleSubmit:m}=a.useForm();return r.createElement(t.Modal,{headerBarMain:r.createElement(y,{t:o}),headerBarEnd:r.createElement(S,{onClick:i}),actionCancelLabel:o(l),actionCancelOnSubmit:s,actionSaveLabel:o(u),actionSaveOnSubmit:m(c),isDisabled:!p,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},r.createElement("form",{onSubmit:m(d)},r.createElement(t.CheckBox,{label:o("ADS_CONFIRM_CANCEL_BOOKING"),onChange:()=>{f(!p)},style:{height:"auto"}}))))},_=e=>{var o,l,s;let{tenantId:u,isLoading:d,t:p,onSubmit:f,data:m,count:v,setShowToast:h,userType:g}=e;const y=window.Digit.Utils.browser.isMobile(),{register:E,control:S,handleSubmit:_,setValue:A,getValues:D,reset:C,formState:T}=a.useForm({defaultValues:{offset:0,limit:!y&&10,sortBy:"createdTime",sortOrder:"DESC",fromDate:(new Date).toISOString().split("T")[0],toDate:(new Date).toISOString().split("T")[0],status:""}});n.useEffect(()=>{E("offset",0),E("limit",10),E("sortBy","createdTime"),E("sortOrder","DESC"),_(f)()},[E]);const[x,N]=n.useState(""),[w,I]=n.useState(!1),L=Digit.Hooks.ads.useADSCreateAPI(u,!1),k=i.useHistory(),{data:O}=(((null==k||null===(o=k.location)||void 0===o?void 0:o.pathname)||"").split("/").pop(),Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}));O&&O.map(e=>{});const R=e=>r.createElement("span",{className:"cell-text"},e),P=function(){try{I(!1);const e=c({},x,{bookingStatus:"CANCELLED"});return Promise.resolve(L.mutateAsync({bookingApplication:e})).then(function(){_(f)()})}catch(e){return Promise.reject(e)}},M=n.useMemo(()=>[{Header:p("ADS_BOOKING_NO"),accessor:"bookingNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(i.Link,{to:"citizen"===g?"/digit-ui/citizen/ads/application/"+t.original.bookingNo+"/"+u:"/digit-ui/employee/ads/applicationsearch/application-details/"+t.original.bookingNo},t.original.bookingNo)))}},{Header:p("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r;return R(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n||null===(r=n.applicantDetail)||void 0===r?void 0:r.applicantName))},disableSortBy:!0},{Header:p("ADS_LOCALITY"),Cell:e=>{var t;let{row:n}=e;const r=null==n||null===(t=n.original)||void 0===t?void 0:t.cartDetails,o=null==r?void 0:r.map(e=>null==e?void 0:e.location).join(", ");return R(o)},disableSortBy:!0},{Header:p("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{let{row:t}=e;return R(""+p(null==t?void 0:t.original.bookingStatus))},disableSortBy:!0}],[]),B=[{i18nKey:"Booked",code:"BOOKED",value:p("ADS_BOOKED")},{i18nKey:"Booking in Progress",code:"BOOKING_CREATED",value:p("ADS_BOOKING_IN_PROGRES")},{i18nKey:"Pending For Payment",code:"PENDING_FOR_PAYMENT",value:p("PENDING_FOR_PAYMENT")},{i18nKey:"Booking Expired",code:"BOOKING_EXPIRED",value:p("BOOKING_EXPIRED")},{i18nKey:"Cancelled",code:"CANCELLED",value:p("ADS_CANCELLED")},{i18nKey:"Available",code:"AVAILABLE",value:p("ADS_AVAILABLE")}],F=n.useCallback(e=>{0!==e.length&&(A("sortBy",e.id),A("sortOrder",e.desc?"DESC":"ASC"))},[]);function j(){A("offset",D("offset")-D("limit")),_(f)()}return r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement(t.Header,null,p("ADS_SEARCH_BOOKINGS")),r.createElement(t.SearchForm,{onSubmit:f,handleSubmit:_},r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_BOOKING_NO")),r.createElement(t.TextInput,{name:"bookingNo",inputRef:E({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_APPLICANT_NAME")),r.createElement(t.TextInput,{name:"applicantName",inputRef:E({})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("PT_COMMON_TABLE_COL_STATUS_LABEL")),r.createElement(a.Controller,{control:S,name:"status",render:e=>r.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:B,optionKey:"i18nKey",t:p,disable:!1})})),r.createElement(t.SearchField,null,r.createElement("label",null,p("ADS_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:E({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:r.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),r.createElement(t.CardLabelError,null,null==T||null===(l=T.errors)||void 0===l||null===(s=l.mobileNumber)||void 0===s?void 0:s.message)),r.createElement(t.SearchField,null,r.createElement("label",null,p("EVENTS_FROM_DATE_LABEL")),r.createElement(a.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange,max:(new Date).toISOString().split("T")[0]}),name:"fromDate",control:S})),r.createElement(t.SearchField,null,r.createElement("label",null,p("EVENTS_TO_DATE_LABEL")),r.createElement(a.Controller,{render:e=>r.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:S})),r.createElement(t.SearchField,{className:"submit"},r.createElement(t.SubmitBar,{label:p("ES_COMMON_SEARCH"),submit:!0}),r.createElement("p",{style:{marginTop:"10px"},onClick:()=>{C({bookingNo:"",applicantName:"",faceArea:"",fromDate:"",toDate:"",mobileNumber:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),h(null),j()}},p("ES_COMMON_CLEAR_ALL")))),!d&&null!=m&&m.display?r.createElement(t.Card,{style:{marginTop:20}},p(m.display).split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):d||""===m?""!==m||d&&r.createElement(t.Loader,null):r.createElement(t.Table,{t:p,data:m,totalRecords:v,columns:M,getCellProps:e=>({style:{minWidth:e.column.Header===p("ADS_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){A("limit",Number(e.target.value)),_(f)()},currentPage:D("offset")/D("limit"),onNextPage:function(){A("offset",D("offset")+D("limit")),_(f)()},onPrevPage:j,pageSizeLimit:D("limit"),onSort:F,disableSort:!1,sortParams:[{id:D("sortBy"),desc:"DESC"===D("sortOrder")}]})),w&&r.createElement(b,{t:p,closeModal:()=>I(!1),actionCancelLabel:"BACK",actionCancelOnSubmit:()=>I(!1),actionSaveLabel:"ADS_CANCEL",actionSaveOnSubmit:P,onSubmit:P}))},A=e=>{var a,l;let{userType:s}=e;i.useParams();const{t:u}=o.useTranslation(),d="undefined"!=typeof window&&(null===(a=window.location)||void 0===a||null===(l=a.href)||void 0===l?void 0:l.includes("citizen"))?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState({}),[m,v]=n.useState(null);n.useEffect(()=>{if(m){const e=setTimeout(()=>{v(null)},1e3);return()=>clearTimeout(e)}},[m]);const h={enabled:!!(p&&Object.keys(p).length>0)},{isLoading:g,isSuccess:y,data:{bookingApplication:E,Count:S}={}}=Digit.Hooks.ads.useADSSearch({tenantId:d,filters:p},h);return r.createElement(r.Fragment,null,r.createElement(_,{t:u,isLoading:g,tenantId:d,setShowToast:v,onSubmit:function(e){const t=c({},e,e.toDate?{toDate:null==e?void 0:e.toDate}:{},e.fromDate?{fromDate:null==e?void 0:e.fromDate}:{});let n=Object.keys(t).filter(e=>t[e]).reduce((e,n)=>c({},e,{[n]:"object"==typeof t[n]?t[n].code:t[n]}),{});!(Object.entries(n).length>0)||n.bookingNo||n.fromDate||n.status||n.applicantName||n.faceArea||n.toDate||n.mobileNumber?Object.entries(n).length>0&&n.fromDate&&!n.toDate||!n.fromDate&&n.toDate?v({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):f(n):v({warning:!0,label:"ERR_PROVIDE_ONE_PARAMETERS"})},data:y&&!g?E.length>0?E:{display:"ES_COMMON_NO_DATA"}:"",count:S,userType:s}),m&&r.createElement(t.Toast,{error:m.error,warning:m.warning,label:u(m.label),onClose:()=>{v(null)}}))},D=["path","url"],C=[],T=()=>{var e,n,a,l,s,u,c,p,f,m;const v=i.useRouteMatch(),{path:h}=v,g=(d(v,D),o.useTranslation(),null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("NewADSStepperForm")),y=null===(a=Digit)||void 0===a||null===(l=a.ComponentRegistryService)||void 0===l?void 0:l.getComponent("ADSMyApplications"),E=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSApplicationDetails"),S=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("ADSResponseCitizen"),b=null===(f=Digit)||void 0===f||null===(m=f.ComponentRegistryService)||void 0===m?void 0:m.getComponent("CitizenApplicationOverview");return r.createElement("span",{className:"ads-citizen",style:{width:"100%"}},r.createElement(i.Switch,null,r.createElement(t.AppContainer,null,(void 0===(_=C)&&(_=[]),_.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":r.createElement(t.BackButton,null,"Back")),r.createElement(t.PrivateRoute,{path:h+"/bookad",component:g}),r.createElement(t.PrivateRoute,{path:h+"/myBookings",component:y}),r.createElement(t.PrivateRoute,{path:h+"/application/:acknowledgementIds/:tenantId",component:E}),r.createElement(t.PrivateRoute,{path:h+"/adsservice/:response/:bookingNo",component:S}),r.createElement(t.PrivateRoute,{path:h+"/adsservice/:application-overview/:bookingNo",component:b}))));var _},x=e=>{var n;let{status:i,searchParams:a,onAssignmentChange:l,statusMap:s}=e;return o.useTranslation(),r.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>l(c({},e,{state:i.state}),i),checked:null==a||null===(u=a.applicationStatus)||void 0===u?void 0:u.some(e=>e.uuid===i.uuid),label:i.name+" ("+((null==s||null===(n=s.find(e=>e.statusid===i.uuid))||void 0===n?void 0:n.count)||"-")+")"});var u},N=e=>{var i,a,l,s,u;let{onAssignmentChange:d,searchParams:p,businessServices:f,statusMap:m}=e;const{t:v}=o.useTranslation(),[h,g]=n.useState(!1),{data:y,isLoading:E}=Digit.Hooks.useApplicationStatusGeneral({businessServices:f},{}),{userRoleStates:S}=y||{},b={"ADV.CREATE":v("ES_ADV_NEW_BOOKING"),"ADV.UPDATE":v("ES_ADV_UPDATE_BOOKING")},_=(e,t)=>t(b[e.stateBusinessService])+" - "+t("ES_ADS_COMMON_STATUS_"+(e.state||"CREATED"));return E?r.createElement(t.Loader,null):null!=S&&S.filter(e=>!e.isTerminateState).length?r.createElement("div",{className:"status-container"},r.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_INBOX_STATUS")),null==S||null===(i=S.filter(e=>!e.isTerminateState))||void 0===i||null===(a=i.slice(0,4))||void 0===a?void 0:a.map((e,t)=>r.createElement(x,{businessServices:f,key:t,onAssignmentChange:d,status:c({name:_(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m})),(null==S||null===(l=S.filter(e=>!e.isTerminateState))||void 0===l?void 0:l.slice(4).length)>0?r.createElement(r.Fragment,null,h&&(null==S||null===(s=S.filter(e=>!e.isTerminateState))||void 0===s||null===(u=s.slice(4))||void 0===u?void 0:u.map((e,t)=>r.createElement(x,{businessServices:f,key:e.uuid,onAssignmentChange:d,status:c({name:_(e,v),code:e.applicationStatus},e),searchParams:p,statusMap:m}))),r.createElement("div",{className:"filter-button",onClick:()=>g(!h)}," ",v(h?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null};var w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function I(e,t){return e(t={exports:{}},t.exports),t.exports}var L=I(function(e,t){(function(){var n="Expected a function",r="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",a="[object Array]",l="[object Boolean]",s="[object Date]",u="[object Error]",c="[object Function]",d="[object GeneratorFunction]",p="[object Map]",f="[object Number]",m="[object Object]",v="[object RegExp]",h="[object Set]",g="[object String]",y="[object Symbol]",E="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",_="[object Float32Array]",A="[object Float64Array]",D="[object Int8Array]",C="[object Int16Array]",T="[object Int32Array]",x="[object Uint8Array]",N="[object Uint16Array]",I="[object Uint32Array]",L=/\b__p \+= '';/g,k=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,M=RegExp(R.source),B=RegExp(P.source),F=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/[\\^$.*+?()[\]{}|]/g,V=RegExp(q.source),G=/^\s+/,K=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,re=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",fe="["+ce+"]",me="\\d+",ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ge="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",_e="(?:"+ve+"|"+he+")",Ae="(?:"+be+"|"+he+")",De="(?:"+fe+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[ye,Ee,Se].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",Ee,Se].join("|")+")"+Ce,xe="(?:"+[ye+fe+"?",fe,Ee,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),we=RegExp(fe,"g"),Ie=RegExp(ge+"(?="+ge+")|"+xe+Ce,"g"),Le=RegExp([be+"?"+ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,be,"$"].join("|")+")",Ae+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,be+_e,"$"].join("|")+")",be+"?"+_e+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Te].join("|"),"g"),ke=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Oe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Pe=-1,Me={};Me[_]=Me[A]=Me[D]=Me[C]=Me[T]=Me[x]=Me["[object Uint8ClampedArray]"]=Me[N]=Me[I]=!0,Me[i]=Me[a]=Me[S]=Me[l]=Me[b]=Me[s]=Me[u]=Me[c]=Me[p]=Me[f]=Me[m]=Me[v]=Me[h]=Me[g]=Me[E]=!1;var Be={};Be[i]=Be[a]=Be[S]=Be[b]=Be[l]=Be[s]=Be[_]=Be[A]=Be[D]=Be[C]=Be[T]=Be[p]=Be[f]=Be[m]=Be[v]=Be[h]=Be[g]=Be[y]=Be[x]=Be["[object Uint8ClampedArray]"]=Be[N]=Be[I]=!0,Be[u]=Be[c]=Be[E]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},je=parseFloat,He=parseInt,Ue="object"==typeof w&&w&&w.Object===Object&&w,ze="object"==typeof self&&self&&self.Object===Object&&self,We=Ue||ze||Function("return this")(),qe=t&&!t.nodeType&&t,Ve=qe&&e&&!e.nodeType&&e,Ge=Ve&&Ve.exports===qe,Ke=Ge&&Ue.process,Ye=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),$e=Ye&&Ye.isArrayBuffer,Xe=Ye&&Ye.isDate,Ze=Ye&&Ye.isMap,Je=Ye&&Ye.isRegExp,Qe=Ye&&Ye.isSet,et=Ye&&Ye.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function lt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function st(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function ut(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ct(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function dt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function pt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function ft(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var mt=bt("length");function vt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function ht(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function gt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):ht(e,Et,n)}function yt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Et(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function _t(e){return function(t){return null==e?void 0:e[t]}}function At(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function Dt(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function Ct(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Tt(e){return e?e.slice(0,qt(e)+1).replace(G,""):e}function xt(e){return function(t){return e(t)}}function Nt(e,t){return ut(t,function(t){return e[t]})}function wt(e,t){return e.has(t)}function It(e,t){for(var n=-1,r=e.length;++n<r&>(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length;n--&>(t,e[n],0)>-1;);return n}function kt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Ot=_t({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Rt=_t({"&":"&","<":"<",">":">",'"':""","'":"'"});function Pt(e){return"\\"+Fe[e]}function Mt(e){return ke.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Ft(e,t){return function(n){return e(t(n))}}function jt(e,t){for(var n=-1,o=e.length,i=0,a=[];++n<o;){var l=e[n];l!==t&&l!==r||(e[n]=r,a[i++]=n)}return a}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function zt(e){return Mt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):mt(e)}function Wt(e){return Mt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function qt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Vt=_t({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var w,K=(t=null==t?We:Gt.defaults(We.Object(),t,Gt.pick(We,Re))).Array,ce=t.Date,de=t.Error,pe=t.Function,fe=t.Math,me=t.Object,ve=t.RegExp,he=t.String,ge=t.TypeError,ye=K.prototype,Ee=me.prototype,Se=t["__core-js_shared__"],be=pe.prototype.toString,_e=Ee.hasOwnProperty,Ae=0,De=(w=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Ce=Ee.toString,Te=be.call(me),xe=We._,Ie=ve("^"+be.call(_e).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ke=Ge?t.Buffer:void 0,Fe=t.Symbol,Ue=t.Uint8Array,ze=ke?ke.allocUnsafe:void 0,qe=Ft(me.getPrototypeOf,me),Ve=me.create,Ke=Ee.propertyIsEnumerable,Ye=ye.splice,mt=Fe?Fe.isConcatSpreadable:void 0,_t=Fe?Fe.iterator:void 0,Kt=Fe?Fe.toStringTag:void 0,Yt=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==We.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==We.Date.now&&ce.now,Zt=t.setTimeout!==We.setTimeout&&t.setTimeout,Jt=fe.ceil,Qt=fe.floor,en=me.getOwnPropertySymbols,tn=ke?ke.isBuffer:void 0,nn=t.isFinite,rn=ye.join,on=Ft(me.keys,me),an=fe.max,ln=fe.min,sn=ce.now,un=t.parseInt,cn=fe.random,dn=ye.reverse,pn=Qo(t,"DataView"),fn=Qo(t,"Map"),mn=Qo(t,"Promise"),vn=Qo(t,"Set"),hn=Qo(t,"WeakMap"),gn=Qo(me,"create"),yn=hn&&new hn,En={},Sn=Ni(pn),bn=Ni(fn),_n=Ni(mn),An=Ni(vn),Dn=Ni(hn),Cn=Fe?Fe.prototype:void 0,Tn=Cn?Cn.valueOf:void 0,xn=Cn?Cn.toString:void 0;function Nn(e){if(Va(e)&&!Ra(e)&&!(e instanceof kn)){if(e instanceof Ln)return e;if(_e.call(e,"__wrapped__"))return wi(e)}return new Ln(e)}var wn=function(){function e(){}return function(t){if(!qa(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function Ln(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function kn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}function Bn(e){var t=this.__data__=new Rn(e);this.size=t.size}function Fn(e,t){var n=Ra(e),r=!n&&Oa(e),o=!n&&!r&&Fa(e),i=!n&&!r&&!o&&Qa(e),a=n||r||o||i,l=a?Ct(e.length,he):[],s=l.length;for(var u in e)!t&&!_e.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ai(u,s))||l.push(u);return l}function jn(e){var t=e.length;return t?e[Pr(0,t-1)]:void 0}function Hn(e,t){return Ai(go(e),$n(t,0,e.length))}function Un(e){return Ai(go(e))}function zn(e,t,n){(void 0!==n&&!Ia(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function Wn(e,t,n){var r=e[t];_e.call(e,t)&&Ia(r,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function qn(e,t){for(var n=e.length;n--;)if(Ia(e[n][0],t))return n;return-1}function Vn(e,t,n,r){return er(e,function(e,o,i){t(r,e,n(e),i)}),r}function Gn(e,t){return e&&yo(t,bl(t),e)}function Kn(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,r=t.length,o=K(r),i=null==e;++n<r;)o[n]=i?void 0:hl(e,t[n]);return o}function $n(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,r,o,a){var u,E=1&t,w=2&t,L=4&t;if(n&&(u=o?n(e,r,o,a):n(e)),void 0!==u)return u;if(!qa(e))return e;var k=Ra(e);if(k){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!E)return go(e,u)}else{var O=ni(e),R=O==c||O==d;if(Fa(e))return co(e,E);if(O==m||O==i||R&&!o){if(u=w||R?{}:oi(e),!E)return w?function(e,t){return yo(e,ti(e),t)}(e,function(e,t){return e&&yo(t,_l(t),e)}(u,e)):function(e,t){return yo(e,ei(e),t)}(e,Gn(u,e))}else{if(!Be[O])return o?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case S:return po(e);case l:case s:return new r(+e);case b:return function(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case _:case A:case D:case C:case T:case x:case"[object Uint8ClampedArray]":case N:case I:return fo(e,n);case p:return new r;case f:case g:return new r(e);case v:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return new r;case y:return Tn?me(Tn.call(e)):{}}}(e,O,E)}}a||(a=new Bn);var P=a.get(e);if(P)return P;a.set(e,u),Xa(e)?e.forEach(function(r){u.add(Xn(r,t,n,r,e,a))}):Ga(e)&&e.forEach(function(r,o){u.set(o,Xn(r,t,n,o,e,a))});var M=k?void 0:(L?w?Go:Vo:w?_l:bl)(e);return rt(M||e,function(r,o){M&&(r=e[o=r]),Wn(u,o,Xn(r,t,n,o,e,a))}),u}function Zn(e,t,n){var r=n.length;if(null==e)return!r;for(e=me(e);r--;){var o=n[r],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,r){if("function"!=typeof e)throw new ge(n);return Ei(function(){e.apply(void 0,r)},t)}function Qn(e,t,n,r){var o=-1,i=lt,a=!0,l=e.length,s=[],u=t.length;if(!l)return s;n&&(t=ut(t,xt(n))),r?(i=st,a=!1):t.length>=200&&(i=wt,a=!1,t=new Mn(t));e:for(;++o<l;){var c=e[o],d=null==n?c:n(c);if(c=r||0!==c?c:0,a&&d==d){for(var p=u;p--;)if(t[p]===d)continue e;s.push(c)}else i(t,d,r)||s.push(c)}return s}Nn.templateSettings={escape:F,evaluate:j,interpolate:H,variable:"",imports:{_:Nn}},(Nn.prototype=In.prototype).constructor=Nn,(Ln.prototype=wn(In.prototype)).constructor=Ln,(kn.prototype=wn(In.prototype)).constructor=kn,On.prototype.clear=function(){this.__data__=gn?gn(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(gn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return _e.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return gn?void 0!==t[e]:_e.call(t,e)},On.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gn&&void 0===t?"__lodash_hash_undefined__":t,this},Rn.prototype.clear=function(){this.__data__=[],this.size=0},Rn.prototype.delete=function(e){var t=this.__data__,n=qn(t,e);return!(n<0||(n==t.length-1?t.pop():Ye.call(t,n,1),--this.size,0))},Rn.prototype.get=function(e){var t=this.__data__,n=qn(t,e);return n<0?void 0:t[n][1]},Rn.prototype.has=function(e){return qn(this.__data__,e)>-1},Rn.prototype.set=function(e,t){var n=this.__data__,r=qn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(fn||Rn),string:new On}},Pn.prototype.delete=function(e){var t=Zo(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Zo(this,e).get(e)},Pn.prototype.has=function(e){return Zo(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Zo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.clear=function(){this.__data__=new Rn,this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Bn.prototype.get=function(e){return this.__data__.get(e)},Bn.prototype.has=function(e){return this.__data__.has(e)},Bn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Rn){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=bo(sr),tr=bo(ur,!0);function nr(e,t){var n=!0;return er(e,function(e,r,o){return n=!!t(e,r,o)}),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],a=t(i);if(null!=a&&(void 0===l?a==a&&!Ja(a):n(a,l)))var l=a,s=i}return s}function or(e,t){var n=[];return er(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function ir(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ii),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?ir(l,t-1,n,r,o):ct(o,l):r||(o[o.length]=l)}return o}var ar=_o(),lr=_o(!0);function sr(e,t){return e&&ar(e,t,bl)}function ur(e,t){return e&&lr(e,t,bl)}function cr(e,t){return at(t,function(t){return Ua(e[t])})}function dr(e,t){for(var n=0,r=(t=ao(t,e)).length;null!=e&&n<r;)e=e[xi(t[n++])];return n&&n==r?e:void 0}function pr(e,t,n){var r=t(e);return Ra(e)?r:ct(r,n(e))}function fr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=_e.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var r=!0}catch(e){}var o=Ce.call(e);return r&&(t?e[Kt]=n:delete e[Kt]),o}(e):function(e){return Ce.call(e)}(e)}function mr(e,t){return e>t}function vr(e,t){return null!=e&&_e.call(e,t)}function hr(e,t){return null!=e&&t in me(e)}function gr(e,t,n){for(var r=n?st:lt,o=e[0].length,i=e.length,a=i,l=K(i),s=Infinity,u=[];a--;){var c=e[a];a&&t&&(c=ut(c,xt(t))),s=ln(c.length,s),l[a]=!n&&(t||o>=120&&c.length>=120)?new Mn(a&&c):void 0}c=e[0];var d=-1,p=l[0];e:for(;++d<o&&u.length<s;){var f=c[d],m=t?t(f):f;if(f=n||0!==f?f:0,!(p?wt(p,m):r(u,m,n))){for(a=i;--a;){var v=l[a];if(!(v?wt(v,m):r(e[a],m,n)))continue e}p&&p.push(m),u.push(f)}}return u}function yr(e,t,n){var r=null==(e=vi(e,t=ao(t,e)))?e:e[xi(Hi(t))];return null==r?void 0:tt(r,e,n)}function Er(e){return Va(e)&&fr(e)==i}function Sr(e,t,n,r,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,n,r,o,c){var d=Ra(e),E=Ra(t),_=d?a:ni(e),A=E?a:ni(t),D=(_=_==i?m:_)==m,C=(A=A==i?m:A)==m,T=_==A;if(T&&Fa(e)){if(!Fa(t))return!1;d=!0,D=!1}if(T&&!D)return c||(c=new Bn),d||Qa(e)?Wo(e,t,n,r,o,c):function(e,t,n,r,o,i,a){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!i(new Ue(e),new Ue(t)));case l:case s:case f:return Ia(+e,+t);case u:return e.name==t.name&&e.message==t.message;case v:case g:return e==t+"";case p:var c=Bt;case h:if(c||(c=Ht),e.size!=t.size&&!(1&r))return!1;var d=a.get(e);if(d)return d==t;r|=2,a.set(e,t);var m=Wo(c(e),c(t),r,o,i,a);return a.delete(e),m;case y:if(Tn)return Tn.call(e)==Tn.call(t)}return!1}(e,t,_,n,r,o,c);if(!(1&n)){var x=D&&_e.call(e,"__wrapped__"),N=C&&_e.call(t,"__wrapped__");if(x||N){var w=x?e.value():e,I=N?t.value():t;return c||(c=new Bn),o(w,I,n,r,c)}}return!!T&&(c||(c=new Bn),function(e,t,n,r,o,i){var a=1&n,l=Vo(e),s=l.length;if(s!=Vo(t).length&&!a)return!1;for(var u=s;u--;){var c=l[u];if(!(a?c in t:_e.call(t,c)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var m=a;++u<s;){var v=e[c=l[u]],h=t[c];if(r)var g=a?r(h,v,c,t,e,i):r(v,h,c,e,t,i);if(!(void 0===g?v===h||o(v,h,n,r,i):g)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var y=e.constructor,E=t.constructor;y==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof E&&E instanceof E||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,r,o,c))}(e,t,n,r,Sr,o))}function br(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=me(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<i;){var s=(l=n[o])[0],u=e[s],c=l[1];if(a&&l[2]){if(void 0===u&&!(s in e))return!1}else{var d=new Bn;if(r)var p=r(u,c,s,e,t,d);if(!(void 0===p?Sr(c,u,3,r,d):p))return!1}}return!0}function _r(e){return!(!qa(e)||(t=e,De&&De in t))&&(Ua(e)?Ie:oe).test(Ni(e));var t}function Ar(e){return"function"==typeof e?e:null==e?Kl:"object"==typeof e?Ra(e)?Nr(e[0],e[1]):xr(e):ns(e)}function Dr(e){if(!di(e))return on(e);var t=[];for(var n in me(e))_e.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cr(e,t){return e<t}function Tr(e,t){var n=-1,r=Ma(e)?K(e.length):[];return er(e,function(e,o,i){r[++n]=t(e,o,i)}),r}function xr(e){var t=Jo(e);return 1==t.length&&t[0][2]?fi(t[0][0],t[0][1]):function(n){return n===e||br(n,e,t)}}function Nr(e,t){return si(e)&&pi(t)?fi(xi(e),t):function(n){var r=hl(n,e);return void 0===r&&r===t?gl(n,e):Sr(t,r,3)}}function wr(e,t,n,r,o){e!==t&&ar(t,function(i,a){if(o||(o=new Bn),qa(i))!function(e,t,n,r,o,i,a){var l=gi(e,n),s=gi(t,n),u=a.get(s);if(u)zn(e,n,u);else{var c=i?i(l,s,n+"",e,t,a):void 0,d=void 0===c;if(d){var p=Ra(s),f=!p&&Fa(s),m=!p&&!f&&Qa(s);c=s,p||f||m?Ra(l)?c=l:Ba(l)?c=go(l):f?(d=!1,c=co(s,!0)):m?(d=!1,c=fo(s,!0)):c=[]:Ya(s)||Oa(s)?(c=l,Oa(l)?c=ll(l):qa(l)&&!Ua(l)||(c=oi(s))):d=!1}d&&(a.set(s,c),o(c,s,r,i,a),a.delete(s)),zn(e,n,c)}}(e,t,a,n,wr,r,o);else{var l=r?r(gi(e,a),i,a+"",e,t,o):void 0;void 0===l&&(l=i),zn(e,a,l)}},_l)}function Ir(e,t){var n=e.length;if(n)return ai(t+=t<0?n:0,n)?e[t]:void 0}function Lr(e,t,n){t=t.length?ut(t,function(e){return Ra(e)?function(t){return dr(t,1===e.length?e[0]:e)}:e}):[Kl];var r=-1;return t=ut(t,xt(Xo())),function(e,t){var r=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,a=o.length,l=n.length;++r<a;){var s=mo(o[r],i[r]);if(s)return r>=l?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Tr(e,function(e,n,o){return{criteria:ut(t,function(t){return t(e)}),index:++r,value:e}}))}function kr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=dr(e,a);n(l,a)&&Hr(i,ao(a,e),l)}return i}function Or(e,t,n,r){var o=r?yt:gt,i=-1,a=t.length,l=e;for(e===t&&(t=go(t)),n&&(l=ut(e,xt(n)));++i<a;)for(var s=0,u=t[i],c=n?n(u):u;(s=o(l,c,s,r))>-1;)l!==e&&Ye.call(l,s,1),Ye.call(e,s,1);return e}function Rr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;ai(o)?Ye.call(e,o,1):Jr(e,o)}}return e}function Pr(e,t){return e+Qt(cn()*(t-e+1))}function Mr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return Si(mi(e,t,Kl),e+"")}function Fr(e){return jn(Il(e))}function jr(e,t){var n=Il(e);return Ai(n,$n(t,0,n.length))}function Hr(e,t,n,r){if(!qa(e))return e;for(var o=-1,i=(t=ao(t,e)).length,a=i-1,l=e;null!=l&&++o<i;){var s=xi(t[o]),u=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return e;if(o!=a){var c=l[s];void 0===(u=r?r(c,s,l):void 0)&&(u=qa(c)?c:ai(t[o+1])?[]:{})}Wn(l,s,u),l=l[s]}return e}var Ur=yn?function(e,t){return yn.set(e,t),e}:Kl,zr=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:ql(t),writable:!0})}:Kl;function Wr(e){return Ai(Il(e))}function qr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=K(o);++r<o;)i[r]=e[r+t];return i}function Vr(e,t){var n;return er(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!Ja(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return Kr(e,t,Kl,n)}function Kr(e,t,n,r){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=n(t))!=t,l=null===t,s=Ja(t),u=void 0===t;o<i;){var c=Qt((o+i)/2),d=n(e[c]),p=void 0!==d,f=null===d,m=d==d,v=Ja(d);if(a)var h=r||m;else h=u?m&&(r||p):l?m&&p&&(r||!f):s?m&&p&&!f&&(r||!v):!f&&!v&&(r?d<=t:d<t);h?o=c+1:i=c}return ln(i,4294967294)}function Yr(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],l=t?t(a):a;if(!n||!Ia(l,s)){var s=l;i[o++]=0===a?0:a}}return i}function $r(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xr(e){if("string"==typeof e)return e;if(Ra(e))return ut(e,Xr)+"";if(Ja(e))return xn?xn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zr(e,t,n){var r=-1,o=lt,i=e.length,a=!0,l=[],s=l;if(n)a=!1,o=st;else if(i>=200){var u=t?null:Bo(e);if(u)return Ht(u);a=!1,o=wt,s=new Mn}else s=t?[]:l;e:for(;++r<i;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=s.length;p--;)if(s[p]===d)continue e;t&&s.push(d),l.push(c)}else o(s,d,n)||(s!==l&&s.push(d),l.push(c))}return l}function Jr(e,t){return null==(e=vi(e,t=ao(t,e)))||delete e[xi(Hi(t))]}function Qr(e,t,n,r){return Hr(e,t,n(dr(e,t)),r)}function eo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?qr(e,r?0:i,r?i+1:o):qr(e,r?i+1:0,r?o:i)}function to(e,t){var n=e;return n instanceof kn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function no(e,t,n){var r=e.length;if(r<2)return r?Zr(e[0]):[];for(var o=-1,i=K(r);++o<r;)for(var a=e[o],l=-1;++l<r;)l!=o&&(i[o]=Qn(i[o]||a,e[l],t,n));return Zr(ir(i,1),t,n)}function ro(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;)n(a,e[r],r<i?t[r]:void 0);return a}function oo(e){return Ba(e)?e:[]}function io(e){return"function"==typeof e?e:Kl}function ao(e,t){return Ra(e)?e:si(e,t)?[e]:Ti(sl(e))}var lo=Br;function so(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:qr(e,t,n)}var uo=$t||function(e){return We.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function po(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function fo(e,t){var n=t?po(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Ja(e),a=void 0!==t,l=null===t,s=t==t,u=Ja(t);if(!l&&!u&&!i&&e>t||i&&a&&s&&!l&&!u||r&&a&&s||!n&&s||!o)return 1;if(!r&&!i&&!u&&e<t||u&&n&&o&&!r&&!i||l&&n&&o||!a&&o||!s)return-1}return 0}function vo(e,t,n,r){for(var o=-1,i=e.length,a=n.length,l=-1,s=t.length,u=an(i-a,0),c=K(s+u),d=!r;++l<s;)c[l]=t[l];for(;++o<a;)(d||o<i)&&(c[n[o]]=e[o]);for(;u--;)c[l++]=e[o++];return c}function ho(e,t,n,r){for(var o=-1,i=e.length,a=-1,l=n.length,s=-1,u=t.length,c=an(i-l,0),d=K(c+u),p=!r;++o<c;)d[o]=e[o];for(var f=o;++s<u;)d[f+s]=t[s];for(;++a<l;)(p||o<i)&&(d[f+n[a]]=e[o++]);return d}function go(e,t){var n=-1,r=e.length;for(t||(t=K(r));++n<r;)t[n]=e[n];return t}function yo(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var l=t[i],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),o?Kn(n,l,s):Wn(n,l,s)}return n}function Eo(e,t){return function(n,r){var o=Ra(n)?nt:Vn,i=t?t():{};return o(n,e,Xo(r,2),i)}}function So(e){return Br(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&li(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=me(t);++r<o;){var l=n[r];l&&e(t,l,r,i)}return t})}function bo(e,t){return function(n,r){if(null==n)return n;if(!Ma(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=me(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function _o(e){return function(t,n,r){for(var o=-1,i=me(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}function Ao(e){return function(t){var n=Mt(t=sl(t))?Wt(t):void 0,r=n?n[0]:t.charAt(0),o=n?so(n,1).join(""):t.slice(1);return r[e]()+o}}function Do(e){return function(t){return dt(Ul(Ol(t).replace(Ne,"")),e,"")}}function Co(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=wn(e.prototype),r=e.apply(n,t);return qa(r)?r:n}}function To(e){return function(t,n,r){var o=me(t);if(!Ma(t)){var i=Xo(n,3);t=bl(t),n=function(e){return i(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[i?t[a]:a]:void 0}}function xo(e){return qo(function(t){var r=t.length,o=r,i=Ln.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new ge(n);if(i&&!l&&"wrapper"==Yo(a))var l=new Ln([],!0)}for(o=l?o:r;++o<r;){var s=Yo(a=t[o]),u="wrapper"==s?Ko(a):void 0;l=u&&ui(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[Yo(u[0])].apply(l,u[3]):1==a.length&&ui(a)?l[s]():l.thru(a)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ra(n))return l.plant(n).value();for(var o=0,i=r?t[o].apply(this,e):n;++o<r;)i=t[o].call(this,i);return i}})}function No(e,t,n,r,o,i,a,l,s,u){var c=128&t,d=1&t,p=2&t,f=24&t,m=512&t,v=p?void 0:Co(e);return function h(){for(var g=arguments.length,y=K(g),E=g;E--;)y[E]=arguments[E];if(f)var S=$o(h),b=kt(y,S);if(r&&(y=vo(y,r,o,f)),i&&(y=ho(y,i,a,f)),g-=b,f&&g<u){var _=jt(y,S);return Po(e,t,No,h.placeholder,n,y,_,l,s,u-g)}var A=d?n:this,D=p?A[e]:e;return g=y.length,l?y=hi(y,l):m&&g>1&&y.reverse(),c&&s<g&&(y.length=s),this&&this!==We&&this instanceof h&&(D=v||Co(D)),D.apply(A,y)}}function wo(e,t){return function(n,r){return function(e,t,n,r){return sr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Io(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Xr(n),r=Xr(r)):(n=$r(n),r=$r(r)),o=e(n,r)}return o}}function Lo(e){return qo(function(t){return t=ut(t,xt(Xo())),Br(function(n){var r=this;return e(t,function(e){return tt(e,r,n)})})})}function ko(e,t){var n=(t=void 0===t?" ":Xr(t)).length;if(n<2)return n?Mr(t,e):t;var r=Mr(t,Jt(e/zt(t)));return Mt(t)?so(Wt(r),0,e).join(""):r.slice(0,e)}function Oo(e){return function(t,n,r){return r&&"number"!=typeof r&&li(t,n,r)&&(n=r=void 0),t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n,r){for(var o=-1,i=an(Jt((t-e)/(n||1)),0),a=K(i);i--;)a[r?i:++o]=e,e+=n;return a}(t,n,r=void 0===r?t<n?1:-1:rl(r),e)}}function Ro(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=al(t),n=al(n)),e(t,n)}}function Po(e,t,n,r,o,i,a,l,s,u){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,l,s,u],p=n.apply(void 0,d);return ui(e)&&yi(p,d),p.placeholder=r,bi(p,e,t)}function Mo(e){var t=fe[e];return function(e,n){if(e=al(e),(n=null==n?0:ln(ol(n),292))&&nn(e)){var r=(sl(e)+"e").split("e");return+((r=(sl(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Bo=vn&&1/Ht(new vn([,-0]))[1]==1/0?function(e){return new vn(e)}:Jl;function Fo(e){return function(t){var n=ni(t);return n==p?Bt(t):n==h?Ut(t):function(e,t){return ut(t,function(t){return[t,e[t]]})}(t,e(t))}}function jo(e,t,o,i,a,l,s,u){var c=2&t;if(!c&&"function"!=typeof e)throw new ge(n);var d=i?i.length:0;if(d||(t&=-97,i=a=void 0),s=void 0===s?s:an(ol(s),0),u=void 0===u?u:ol(u),d-=a?a.length:0,64&t){var p=i,f=a;i=a=void 0}var m=c?void 0:Ko(e),v=[e,t,o,i,a,p,f,l,s,u];if(m&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var a=t[3];if(a){var l=e[3];e[3]=l?vo(l,a,t[4]):a,e[4]=l?jt(e[3],r):t[4]}(a=t[5])&&(e[5]=(l=e[5])?ho(l,a,t[6]):a,e[6]=l?jt(e[5],r):t[6]),(a=t[7])&&(e[7]=a),128&o&&(e[8]=null==e[8]?t[8]:ln(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(v,m),e=v[0],t=v[1],o=v[2],i=v[3],a=v[4],!(u=v[9]=void 0===v[9]?c?0:e.length:an(v[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var r=Co(e);return function o(){for(var i=arguments.length,a=K(i),l=i,s=$o(o);l--;)a[l]=arguments[l];var u=i<3&&a[0]!==s&&a[i-1]!==s?[]:jt(a,s);if((i-=u.length)<n)return Po(e,t,No,o.placeholder,void 0,a,u,void 0,void 0,n-i);var c=this&&this!==We&&this instanceof o?r:e;return tt(c,this,a)}}(e,t,u):32!=t&&33!=t||a.length?No.apply(void 0,v):function(e,t,n,r){var o=1&t,i=Co(e);return function t(){for(var a=-1,l=arguments.length,s=-1,u=r.length,c=K(u+l),d=this&&this!==We&&this instanceof t?i:e;++s<u;)c[s]=r[s];for(;l--;)c[s++]=arguments[++a];return tt(d,o?n:this,c)}}(e,t,o,i);else var h=function(e,t,n){var r=1&t,o=Co(e);return function t(){var i=this&&this!==We&&this instanceof t?o:e;return i.apply(r?n:this,arguments)}}(e,t,o);return bi((m?Ur:yi)(h,v),e,t)}function Ho(e,t,n,r){return void 0===e||Ia(e,Ee[n])&&!_e.call(r,n)?t:e}function Uo(e,t,n,r,o,i){return qa(e)&&qa(t)&&(i.set(t,e),wr(e,t,void 0,Uo,i),i.delete(t)),e}function zo(e){return Ya(e)?void 0:e}function Wo(e,t,n,r,o,i){var a=1&n,l=e.length,s=t.length;if(l!=s&&!(a&&s>l))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,f=2&n?new Mn:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var m=e[d],v=t[d];if(r)var h=a?r(v,m,d,t,e,i):r(m,v,d,e,t,i);if(void 0!==h){if(h)continue;p=!1;break}if(f){if(!ft(t,function(e,t){if(!wt(f,t)&&(m===e||o(m,e,n,r,i)))return f.push(t)})){p=!1;break}}else if(m!==v&&!o(m,v,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function qo(e){return Si(mi(e,void 0,Pi),e+"")}function Vo(e){return pr(e,bl,ei)}function Go(e){return pr(e,_l,ti)}var Ko=yn?function(e){return yn.get(e)}:Jl;function Yo(e){for(var t=e.name+"",n=En[t],r=_e.call(En,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function $o(e){return(_e.call(Nn,"placeholder")?Nn:e).placeholder}function Xo(){var e=Nn.iteratee||Yl;return e=e===Yl?Ar:e,arguments.length?e(arguments[0],arguments[1]):e}function Zo(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=bl(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,pi(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return _r(n)?n:void 0}var ei=en?function(e){return null==e?[]:(e=me(e),at(en(e),function(t){return Ke.call(e,t)}))}:is,ti=en?function(e){for(var t=[];e;)ct(t,ei(e)),e=qe(e);return t}:is,ni=fr;function ri(e,t,n){for(var r=-1,o=(t=ao(t,e)).length,i=!1;++r<o;){var a=xi(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Wa(o)&&ai(a,o)&&(Ra(e)||Oa(e))}function oi(e){return"function"!=typeof e.constructor||di(e)?{}:wn(qe(e))}function ii(e){return Ra(e)||Oa(e)||!!(mt&&e&&e[mt])}function ai(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function li(e,t,n){if(!qa(n))return!1;var r=typeof t;return!!("number"==r?Ma(n)&&ai(t,n.length):"string"==r&&t in n)&&Ia(n[t],e)}function si(e,t){if(Ra(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ja(e))||z.test(e)||!U.test(e)||null!=t&&e in me(t)}function ui(e){var t=Yo(e),n=Nn[t];if("function"!=typeof n||!(t in kn.prototype))return!1;if(e===n)return!0;var r=Ko(n);return!!r&&e===r[0]}(pn&&ni(new pn(new ArrayBuffer(1)))!=b||fn&&ni(new fn)!=p||mn&&"[object Promise]"!=ni(mn.resolve())||vn&&ni(new vn)!=h||hn&&ni(new hn)!=E)&&(ni=function(e){var t=fr(e),n=t==m?e.constructor:void 0,r=n?Ni(n):"";if(r)switch(r){case Sn:return b;case bn:return p;case _n:return"[object Promise]";case An:return h;case Dn:return E}return t});var ci=Se?Ua:as;function di(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ee)}function pi(e){return e==e&&!qa(e)}function fi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mi(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=an(r.length-t,0),a=K(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=K(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),tt(e,this,l)}}function vi(e,t){return t.length<2?e:dr(e,qr(t,0,-1))}function hi(e,t){for(var n=e.length,r=ln(t.length,n),o=go(e);r--;){var i=t[r];e[r]=ai(i,n)?o[i]:void 0}return e}function gi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var yi=_i(Ur),Ei=Zt||function(e,t){return We.setTimeout(e,t)},Si=_i(zr);function bi(e,t,n){var r=t+"";return Si(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Y,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return rt(o,function(n){var r="_."+n[0];t&n[1]&&!lt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(X):[]}(r),n)))}function _i(e){var t=0,n=0;return function(){var r=sn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ai(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var i=Pr(n,o),a=e[i];e[i]=e[n],e[n]=a}return e.length=t,e}var Di,Ci,Ti=(Di=Da(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(W,function(e,n,r,o){t.push(r?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ci.size&&Ci.clear(),e}),Ci=Di.cache,Di);function xi(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ni(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wi(e){if(e instanceof kn)return e.clone();var t=new Ln(e.__wrapped__,e.__chain__);return t.__actions__=go(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ii=Br(function(e,t){return Ba(e)?Qn(e,ir(t,1,Ba,!0)):[]}),Li=Br(function(e,t){var n=Hi(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ir(t,1,Ba,!0),Xo(n,2)):[]}),ki=Br(function(e,t){var n=Hi(t);return Ba(n)&&(n=void 0),Ba(e)?Qn(e,ir(t,1,Ba,!0),void 0,n):[]});function Oi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),ht(e,Xo(t,3),o)}function Ri(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ol(n),o=n<0?an(r+o,0):ln(o,r-1)),ht(e,Xo(t,3),o,!0)}function Pi(e){return null!=e&&e.length?ir(e,1):[]}function Mi(e){return e&&e.length?e[0]:void 0}var Bi=Br(function(e){var t=ut(e,oo);return t.length&&t[0]===e[0]?gr(t):[]}),Fi=Br(function(e){var t=Hi(e),n=ut(e,oo);return t===Hi(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?gr(n,Xo(t,2)):[]}),ji=Br(function(e){var t=Hi(e),n=ut(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?gr(n,void 0,t):[]});function Hi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ui=Br(zi);function zi(e,t){return e&&e.length&&t&&t.length?Or(e,t):e}var Wi=qo(function(e,t){var n=null==e?0:e.length,r=Yn(e,t);return Rr(e,ut(t,function(e){return ai(e,n)?+e:e}).sort(mo)),r});function qi(e){return null==e?e:dn.call(e)}var Vi=Br(function(e){return Zr(ir(e,1,Ba,!0))}),Gi=Br(function(e){var t=Hi(e);return Ba(t)&&(t=void 0),Zr(ir(e,1,Ba,!0),Xo(t,2))}),Ki=Br(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,Zr(ir(e,1,Ba,!0),void 0,t)});function Yi(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=an(e.length,t),!0}),Ct(t,function(t){return ut(e,bt(t))})}function $i(e,t){if(!e||!e.length)return[];var n=Yi(e);return null==t?n:ut(n,function(e){return tt(t,void 0,e)})}var Xi=Br(function(e,t){return Ba(e)?Qn(e,t):[]}),Zi=Br(function(e){return no(at(e,Ba))}),Ji=Br(function(e){var t=Hi(e);return Ba(t)&&(t=void 0),no(at(e,Ba),Xo(t,2))}),Qi=Br(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,no(at(e,Ba),void 0,t)}),ea=Br(Yi),ta=Br(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$i(e,n)});function na(e){var t=Nn(e);return t.__chain__=!0,t}function ra(e,t){return t(e)}var oa=qo(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof kn&&ai(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ra,args:[o],thisArg:void 0}),new Ln(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),ia=Eo(function(e,t,n){_e.call(e,n)?++e[n]:Kn(e,n,1)}),aa=To(Oi),la=To(Ri);function sa(e,t){return(Ra(e)?rt:er)(e,Xo(t,3))}function ua(e,t){return(Ra(e)?ot:tr)(e,Xo(t,3))}var ca=Eo(function(e,t,n){_e.call(e,n)?e[n].push(t):Kn(e,n,[t])}),da=Br(function(e,t,n){var r=-1,o="function"==typeof t,i=Ma(e)?K(e.length):[];return er(e,function(e){i[++r]=o?tt(t,e,n):yr(e,t,n)}),i}),pa=Eo(function(e,t,n){Kn(e,n,t)});function fa(e,t){return(Ra(e)?ut:Tr)(e,Xo(t,3))}var ma=Eo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),va=Br(function(e,t){if(null==e)return[];var n=t.length;return n>1&&li(e,t[0],t[1])?t=[]:n>2&&li(t[0],t[1],t[2])&&(t=[t[0]]),Lr(e,ir(t,1),[])}),ha=Xt||function(){return We.Date.now()};function ga(e,t,n){return t=n?void 0:t,jo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ya(e,t){var r;if("function"!=typeof t)throw new ge(n);return e=ol(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var Ea=Br(function(e,t,n){var r=1;if(n.length){var o=jt(n,$o(Ea));r|=32}return jo(e,r,t,n,o)}),Sa=Br(function(e,t,n){var r=3;if(n.length){var o=jt(n,$o(Sa));r|=32}return jo(t,r,e,n,o)});function ba(e,t,r){var o,i,a,l,s,u,c=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new ge(n);function m(t){var n=o,r=i;return o=i=void 0,c=t,l=e.apply(r,n)}function v(e){return c=e,s=Ei(g,t),d?m(e):l}function h(e){var n=e-u;return void 0===u||n>=t||n<0||p&&e-c>=a}function g(){var e=ha();if(h(e))return y(e);s=Ei(g,function(e){var n=t-(e-u);return p?ln(n,a-(e-c)):n}(e))}function y(e){return s=void 0,f&&o?m(e):(o=i=void 0,l)}function E(){var e=ha(),n=h(e);if(o=arguments,i=this,u=e,n){if(void 0===s)return v(u);if(p)return uo(s),s=Ei(g,t),m(u)}return void 0===s&&(s=Ei(g,t)),l}return t=al(t)||0,qa(r)&&(d=!!r.leading,a=(p="maxWait"in r)?an(al(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),E.cancel=function(){void 0!==s&&uo(s),c=0,o=u=i=s=void 0},E.flush=function(){return void 0===s?l:y(ha())},E}var _a=Br(function(e,t){return Jn(e,1,t)}),Aa=Br(function(e,t,n){return Jn(e,al(t)||0,n)});function Da(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ge(n);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Da.Cache||Pn),r}function Ca(e){if("function"!=typeof e)throw new ge(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Da.Cache=Pn;var Ta=lo(function(e,t){var n=(t=1==t.length&&Ra(t[0])?ut(t[0],xt(Xo())):ut(ir(t,1),xt(Xo()))).length;return Br(function(r){for(var o=-1,i=ln(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return tt(e,this,r)})}),xa=Br(function(e,t){return jo(e,32,void 0,t,jt(t,$o(xa)))}),Na=Br(function(e,t){return jo(e,64,void 0,t,jt(t,$o(Na)))}),wa=qo(function(e,t){return jo(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var La=Ro(mr),ka=Ro(function(e,t){return e>=t}),Oa=Er(function(){return arguments}())?Er:function(e){return Va(e)&&_e.call(e,"callee")&&!Ke.call(e,"callee")},Ra=K.isArray,Pa=$e?xt($e):function(e){return Va(e)&&fr(e)==S};function Ma(e){return null!=e&&Wa(e.length)&&!Ua(e)}function Ba(e){return Va(e)&&Ma(e)}var Fa=tn||as,ja=Xe?xt(Xe):function(e){return Va(e)&&fr(e)==s};function Ha(e){if(!Va(e))return!1;var t=fr(e);return t==u||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(e)}function Ua(e){if(!qa(e))return!1;var t=fr(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function za(e){return"number"==typeof e&&e==ol(e)}function Wa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Ze?xt(Ze):function(e){return Va(e)&&ni(e)==p};function Ka(e){return"number"==typeof e||Va(e)&&fr(e)==f}function Ya(e){if(!Va(e)||fr(e)!=m)return!1;var t=qe(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Te}var $a=Je?xt(Je):function(e){return Va(e)&&fr(e)==v},Xa=Qe?xt(Qe):function(e){return Va(e)&&ni(e)==h};function Za(e){return"string"==typeof e||!Ra(e)&&Va(e)&&fr(e)==g}function Ja(e){return"symbol"==typeof e||Va(e)&&fr(e)==y}var Qa=et?xt(et):function(e){return Va(e)&&Wa(e.length)&&!!Me[fr(e)]},el=Ro(Cr),tl=Ro(function(e,t){return e<=t});function nl(e){if(!e)return[];if(Ma(e))return Za(e)?Wt(e):go(e);if(_t&&e[_t])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[_t]());var t=ni(e);return(t==p?Bt:t==h?Ht:Il)(e)}function rl(e){return e?(e=al(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ol(e){var t=rl(e),n=t%1;return t==t?n?t-n:t:0}function il(e){return e?$n(ol(e),0,4294967295):0}function al(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Tt(e);var n=re.test(e);return n||ie.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ll(e){return yo(e,_l(e))}function sl(e){return null==e?"":Xr(e)}var ul=So(function(e,t){if(di(t)||Ma(t))yo(t,bl(t),e);else for(var n in t)_e.call(t,n)&&Wn(e,n,t[n])}),cl=So(function(e,t){yo(t,_l(t),e)}),dl=So(function(e,t,n,r){yo(t,_l(t),e,r)}),pl=So(function(e,t,n,r){yo(t,bl(t),e,r)}),fl=qo(Yn),ml=Br(function(e,t){e=me(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&li(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],a=_l(i),l=-1,s=a.length;++l<s;){var u=a[l],c=e[u];(void 0===c||Ia(c,Ee[u])&&!_e.call(e,u))&&(e[u]=i[u])}return e}),vl=Br(function(e){return e.push(void 0,Uo),tt(Dl,void 0,e)});function hl(e,t,n){var r=null==e?void 0:dr(e,t);return void 0===r?n:r}function gl(e,t){return null!=e&&ri(e,t,hr)}var yl=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},ql(Kl)),El=wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),_e.call(e,t)?e[t].push(n):e[t]=[n]},Xo),Sl=Br(yr);function bl(e){return Ma(e)?Fn(e):Dr(e)}function _l(e){return Ma(e)?Fn(e,!0):function(e){if(!qa(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=di(e),n=[];for(var r in e)("constructor"!=r||!t&&_e.call(e,r))&&n.push(r);return n}(e)}var Al=So(function(e,t,n){wr(e,t,n)}),Dl=So(function(e,t,n,r){wr(e,t,n,r)}),Cl=qo(function(e,t){var n={};if(null==e)return n;var r=!1;t=ut(t,function(t){return t=ao(t,e),r||(r=t.length>1),t}),yo(e,Go(e),n),r&&(n=Xn(n,7,zo));for(var o=t.length;o--;)Jr(n,t[o]);return n}),Tl=qo(function(e,t){return null==e?{}:function(e,t){return kr(e,t,function(t,n){return gl(e,n)})}(e,t)});function xl(e,t){if(null==e)return{};var n=ut(Go(e),function(e){return[e]});return t=Xo(t),kr(e,n,function(e,n){return t(e,n[0])})}var Nl=Fo(bl),wl=Fo(_l);function Il(e){return null==e?[]:Nt(e,bl(e))}var Ll=Do(function(e,t,n){return t=t.toLowerCase(),e+(n?kl(t):t)});function kl(e){return Hl(sl(e).toLowerCase())}function Ol(e){return(e=sl(e))&&e.replace(le,Ot).replace(we,"")}var Rl=Do(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Pl=Do(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ml=Ao("toLowerCase"),Bl=Do(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Fl=Do(function(e,t,n){return e+(n?" ":"")+Hl(t)}),jl=Do(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Hl=Ao("toUpperCase");function Ul(e,t,n){return e=sl(e),void 0===(t=n?void 0:t)?function(e){return Oe.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var zl=Br(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ha(e)?e:new de(e)}}),Wl=qo(function(e,t){return rt(t,function(t){t=xi(t),Kn(e,t,Ea(e[t],e))}),e});function ql(e){return function(){return e}}var Vl=xo(),Gl=xo(!0);function Kl(e){return e}function Yl(e){return Ar("function"==typeof e?e:Xn(e,1))}var $l=Br(function(e,t){return function(n){return yr(n,e,t)}}),Xl=Br(function(e,t){return function(n){return yr(e,n,t)}});function Zl(e,t,n){var r=bl(t),o=cr(t,r);null!=n||qa(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=cr(t,bl(t)));var i=!(qa(n)&&"chain"in n&&!n.chain),a=Ua(e);return rt(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=go(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ct([this.value()],arguments))})}),e}function Jl(){}var Ql=Lo(ut),es=Lo(it),ts=Lo(ft);function ns(e){return si(e)?bt(xi(e)):function(e){return function(t){return dr(t,e)}}(e)}var rs=Oo(),os=Oo(!0);function is(){return[]}function as(){return!1}var ls,ss=Io(function(e,t){return e+t},0),us=Mo("ceil"),cs=Io(function(e,t){return e/t},1),ds=Mo("floor"),ps=Io(function(e,t){return e*t},1),fs=Mo("round"),ms=Io(function(e,t){return e-t},0);return Nn.after=function(e,t){if("function"!=typeof t)throw new ge(n);return e=ol(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=ga,Nn.assign=ul,Nn.assignIn=cl,Nn.assignInWith=dl,Nn.assignWith=pl,Nn.at=fl,Nn.before=ya,Nn.bind=Ea,Nn.bindAll=Wl,Nn.bindKey=Sa,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Nn.chain=na,Nn.chunk=function(e,t,n){t=(n?li(e,t,n):void 0===t)?1:an(ol(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var o=0,i=0,a=K(Jt(r/t));o<r;)a[i++]=qr(e,o,o+=t);return a},Nn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=K(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return ct(Ra(n)?go(n):[n],ir(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,r=Xo();return e=t?ut(e,function(e){if("function"!=typeof e[1])throw new ge(n);return[r(e[0]),e[1]]}):[],Br(function(n){for(var r=-1;++r<t;){var o=e[r];if(tt(o[0],this,n))return tt(o[1],this,n)}})},Nn.conforms=function(e){return function(e){var t=bl(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},Nn.constant=ql,Nn.countBy=ia,Nn.create=function(e,t){var n=wn(e);return null==t?n:Gn(n,t)},Nn.curry=function e(t,n,r){var o=jo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Nn.curryRight=function e(t,n,r){var o=jo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Nn.debounce=ba,Nn.defaults=ml,Nn.defaultsDeep=vl,Nn.defer=_a,Nn.delay=Aa,Nn.difference=Ii,Nn.differenceBy=Li,Nn.differenceWith=ki,Nn.drop=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,(t=n||void 0===t?1:ol(t))<0?0:t,r):[]},Nn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,0,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!0):[]},Nn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&li(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=ol(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ol(r))<0&&(r+=o),r=n>r?0:il(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Nn.filter=function(e,t){return(Ra(e)?at:or)(e,Xo(t,3))},Nn.flatMap=function(e,t){return ir(fa(e,t),1)},Nn.flatMapDeep=function(e,t){return ir(fa(e,t),1/0)},Nn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ol(n),ir(fa(e,t),n)},Nn.flatten=Pi,Nn.flattenDeep=function(e){return null!=e&&e.length?ir(e,1/0):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?ir(e,t=void 0===t?1:ol(t)):[]},Nn.flip=function(e){return jo(e,512)},Nn.flow=Vl,Nn.flowRight=Gl,Nn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Nn.functions=function(e){return null==e?[]:cr(e,bl(e))},Nn.functionsIn=function(e){return null==e?[]:cr(e,_l(e))},Nn.groupBy=ca,Nn.initial=function(e){return null!=e&&e.length?qr(e,0,-1):[]},Nn.intersection=Bi,Nn.intersectionBy=Fi,Nn.intersectionWith=ji,Nn.invert=yl,Nn.invertBy=El,Nn.invokeMap=da,Nn.iteratee=Yl,Nn.keyBy=pa,Nn.keys=bl,Nn.keysIn=_l,Nn.map=fa,Nn.mapKeys=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,t(e,r,o),e)}),n},Nn.mapValues=function(e,t){var n={};return t=Xo(t,3),sr(e,function(e,r,o){Kn(n,r,t(e,r,o))}),n},Nn.matches=function(e){return xr(Xn(e,1))},Nn.matchesProperty=function(e,t){return Nr(e,Xn(t,1))},Nn.memoize=Da,Nn.merge=Al,Nn.mergeWith=Dl,Nn.method=$l,Nn.methodOf=Xl,Nn.mixin=Zl,Nn.negate=Ca,Nn.nthArg=function(e){return e=ol(e),Br(function(t){return Ir(t,e)})},Nn.omit=Cl,Nn.omitBy=function(e,t){return xl(e,Ca(Xo(t)))},Nn.once=function(e){return ya(2,e)},Nn.orderBy=function(e,t,n,r){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(n=r?void 0:n)||(n=null==n?[]:[n]),Lr(e,t,n))},Nn.over=Ql,Nn.overArgs=Ta,Nn.overEvery=es,Nn.overSome=ts,Nn.partial=xa,Nn.partialRight=Na,Nn.partition=ma,Nn.pick=Tl,Nn.pickBy=xl,Nn.property=ns,Nn.propertyOf=function(e){return function(t){return null==e?void 0:dr(e,t)}},Nn.pull=Ui,Nn.pullAll=zi,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,Xo(n,2)):e},Nn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Or(e,t,void 0,n):e},Nn.pullAt=Wi,Nn.range=rs,Nn.rangeRight=os,Nn.rearg=wa,Nn.reject=function(e,t){return(Ra(e)?at:or)(e,Ca(Xo(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=Xo(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Rr(e,o),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new ge(n);return Br(e,t=void 0===t?t:ol(t))},Nn.reverse=qi,Nn.sampleSize=function(e,t,n){return t=(n?li(e,t,n):void 0===t)?1:ol(t),(Ra(e)?Hn:jr)(e,t)},Nn.set=function(e,t,n){return null==e?e:Hr(e,t,n)},Nn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Hr(e,t,n,r)},Nn.shuffle=function(e){return(Ra(e)?Un:Wr)(e)},Nn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&li(e,t,n)?(t=0,n=r):(t=null==t?0:ol(t),n=void 0===n?r:ol(n)),qr(e,t,n)):[]},Nn.sortBy=va,Nn.sortedUniq=function(e){return e&&e.length?Yr(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?Yr(e,Xo(t,2)):[]},Nn.split=function(e,t,n){return n&&"number"!=typeof n&&li(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=sl(e))&&("string"==typeof t||null!=t&&!$a(t))&&!(t=Xr(t))&&Mt(e)?so(Wt(e),0,n):e.split(t,n):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new ge(n);return t=null==t?0:an(ol(t),0),Br(function(n){var r=n[t],o=so(n,0,t);return r&&ct(o,r),tt(e,this,o)})},Nn.tail=function(e){var t=null==e?0:e.length;return t?qr(e,1,t):[]},Nn.take=function(e,t,n){return e&&e.length?qr(e,0,(t=n||void 0===t?1:ol(t))<0?0:t):[]},Nn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t,r):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?eo(e,Xo(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,r){var o=!0,i=!0;if("function"!=typeof e)throw new ge(n);return qa(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),ba(e,t,{leading:o,maxWait:t,trailing:i})},Nn.thru=ra,Nn.toArray=nl,Nn.toPairs=Nl,Nn.toPairsIn=wl,Nn.toPath=function(e){return Ra(e)?ut(e,xi):Ja(e)?[e]:go(Ti(sl(e)))},Nn.toPlainObject=ll,Nn.transform=function(e,t,n){var r=Ra(e),o=r||Fa(e)||Qa(e);if(t=Xo(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:qa(e)&&Ua(i)?wn(qe(e)):{}}return(o?rt:sr)(e,function(e,r,o){return t(n,e,r,o)}),n},Nn.unary=function(e){return ga(e,1)},Nn.union=Vi,Nn.unionBy=Gi,Nn.unionWith=Ki,Nn.uniq=function(e){return e&&e.length?Zr(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?Zr(e,Xo(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zr(e,void 0,t):[]},Nn.unset=function(e,t){return null==e||Jr(e,t)},Nn.unzip=Yi,Nn.unzipWith=$i,Nn.update=function(e,t,n){return null==e?e:Qr(e,t,io(n))},Nn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Qr(e,t,io(n),r)},Nn.values=Il,Nn.valuesIn=function(e){return null==e?[]:Nt(e,_l(e))},Nn.without=Xi,Nn.words=Ul,Nn.wrap=function(e,t){return xa(io(t),e)},Nn.xor=Zi,Nn.xorBy=Ji,Nn.xorWith=Qi,Nn.zip=ea,Nn.zipObject=function(e,t){return ro(e||[],t||[],Wn)},Nn.zipObjectDeep=function(e,t){return ro(e||[],t||[],Hr)},Nn.zipWith=ta,Nn.entries=Nl,Nn.entriesIn=wl,Nn.extend=cl,Nn.extendWith=dl,Zl(Nn,Nn),Nn.add=ss,Nn.attempt=zl,Nn.camelCase=Ll,Nn.capitalize=kl,Nn.ceil=us,Nn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=al(n))==n?n:0),void 0!==t&&(t=(t=al(t))==t?t:0),$n(al(e),t,n)},Nn.clone=function(e){return Xn(e,4)},Nn.cloneDeep=function(e){return Xn(e,5)},Nn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Nn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Nn.conformsTo=function(e,t){return null==t||Zn(e,t,bl(t))},Nn.deburr=Ol,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=cs,Nn.endsWith=function(e,t,n){e=sl(e),t=Xr(t);var r=e.length,o=n=void 0===n?r:$n(ol(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Nn.eq=Ia,Nn.escape=function(e){return(e=sl(e))&&B.test(e)?e.replace(P,Rt):e},Nn.escapeRegExp=function(e){return(e=sl(e))&&V.test(e)?e.replace(q,"\\$&"):e},Nn.every=function(e,t,n){var r=Ra(e)?it:nr;return n&&li(e,t,n)&&(t=void 0),r(e,Xo(t,3))},Nn.find=aa,Nn.findIndex=Oi,Nn.findKey=function(e,t){return vt(e,Xo(t,3),sr)},Nn.findLast=la,Nn.findLastIndex=Ri,Nn.findLastKey=function(e,t){return vt(e,Xo(t,3),ur)},Nn.floor=ds,Nn.forEach=sa,Nn.forEachRight=ua,Nn.forIn=function(e,t){return null==e?e:ar(e,Xo(t,3),_l)},Nn.forInRight=function(e,t){return null==e?e:lr(e,Xo(t,3),_l)},Nn.forOwn=function(e,t){return e&&sr(e,Xo(t,3))},Nn.forOwnRight=function(e,t){return e&&ur(e,Xo(t,3))},Nn.get=hl,Nn.gt=La,Nn.gte=ka,Nn.has=function(e,t){return null!=e&&ri(e,t,vr)},Nn.hasIn=gl,Nn.head=Mi,Nn.identity=Kl,Nn.includes=function(e,t,n,r){e=Ma(e)?e:Il(e),n=n&&!r?ol(n):0;var o=e.length;return n<0&&(n=an(o+n,0)),Za(e)?n<=o&&e.indexOf(t,n)>-1:!!o&>(e,t,n)>-1},Nn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=an(r+o,0)),gt(e,t,o)},Nn.inRange=function(e,t,n){return t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n){return e>=ln(t,n)&&e<an(t,n)}(e=al(e),t,n)},Nn.invoke=Sl,Nn.isArguments=Oa,Nn.isArray=Ra,Nn.isArrayBuffer=Pa,Nn.isArrayLike=Ma,Nn.isArrayLikeObject=Ba,Nn.isBoolean=function(e){return!0===e||!1===e||Va(e)&&fr(e)==l},Nn.isBuffer=Fa,Nn.isDate=ja,Nn.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ya(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(Ma(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Qa(e)||Oa(e)))return!e.length;var t=ni(e);if(t==p||t==h)return!e.size;if(di(e))return!Dr(e).length;for(var n in e)if(_e.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return Sr(e,t)},Nn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?Sr(e,t,void 0,n):!!r},Nn.isError=Ha,Nn.isFinite=function(e){return"number"==typeof e&&nn(e)},Nn.isFunction=Ua,Nn.isInteger=za,Nn.isLength=Wa,Nn.isMap=Ga,Nn.isMatch=function(e,t){return e===t||br(e,t,Jo(t))},Nn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,br(e,t,Jo(t),n)},Nn.isNaN=function(e){return Ka(e)&&e!=+e},Nn.isNative=function(e){if(ci(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _r(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=Ka,Nn.isObject=qa,Nn.isObjectLike=Va,Nn.isPlainObject=Ya,Nn.isRegExp=$a,Nn.isSafeInteger=function(e){return za(e)&&e>=-9007199254740991&&e<=9007199254740991},Nn.isSet=Xa,Nn.isString=Za,Nn.isSymbol=Ja,Nn.isTypedArray=Qa,Nn.isUndefined=function(e){return void 0===e},Nn.isWeakMap=function(e){return Va(e)&&ni(e)==E},Nn.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==fr(e)},Nn.join=function(e,t){return null==e?"":rn.call(e,t)},Nn.kebabCase=Rl,Nn.last=Hi,Nn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ol(n))<0?an(r+o,0):ln(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):ht(e,Et,o,!0)},Nn.lowerCase=Pl,Nn.lowerFirst=Ml,Nn.lt=el,Nn.lte=tl,Nn.max=function(e){return e&&e.length?rr(e,Kl,mr):void 0},Nn.maxBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),mr):void 0},Nn.mean=function(e){return St(e,Kl)},Nn.meanBy=function(e,t){return St(e,Xo(t,2))},Nn.min=function(e){return e&&e.length?rr(e,Kl,Cr):void 0},Nn.minBy=function(e,t){return e&&e.length?rr(e,Xo(t,2),Cr):void 0},Nn.stubArray=is,Nn.stubFalse=as,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=ps,Nn.nth=function(e,t){return e&&e.length?Ir(e,ol(t)):void 0},Nn.noConflict=function(){return We._===this&&(We._=xe),this},Nn.noop=Jl,Nn.now=ha,Nn.pad=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return ko(Qt(o),n)+e+ko(Jt(o),n)},Nn.padEnd=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?e+ko(t-r,n):e},Nn.padStart=function(e,t,n){e=sl(e);var r=(t=ol(t))?zt(e):0;return t&&r<t?ko(t-r,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(sl(e).replace(G,""),t||0)},Nn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&li(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=rl(e),void 0===t?(t=e,e=0):t=rl(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=cn();return ln(e+o*(t-e+je("1e-"+((o+"").length-1))),t)}return Pr(e,t)},Nn.reduce=function(e,t,n){var r=Ra(e)?dt:At,o=arguments.length<3;return r(e,Xo(t,4),n,o,er)},Nn.reduceRight=function(e,t,n){var r=Ra(e)?pt:At,o=arguments.length<3;return r(e,Xo(t,4),n,o,tr)},Nn.repeat=function(e,t,n){return t=(n?li(e,t,n):void 0===t)?1:ol(t),Mr(sl(e),t)},Nn.replace=function(){var e=arguments,t=sl(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,n){var r=-1,o=(t=ao(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var i=null==e?void 0:e[xi(t[r])];void 0===i&&(r=o,i=n),e=Ua(i)?i.call(e):i}return e},Nn.round=fs,Nn.runInContext=e,Nn.sample=function(e){return(Ra(e)?jn:Fr)(e)},Nn.size=function(e){if(null==e)return 0;if(Ma(e))return Za(e)?zt(e):e.length;var t=ni(e);return t==p||t==h?e.size:Dr(e).length},Nn.snakeCase=Bl,Nn.some=function(e,t,n){var r=Ra(e)?ft:Vr;return n&&li(e,t,n)&&(t=void 0),r(e,Xo(t,3))},Nn.sortedIndex=function(e,t){return Gr(e,t)},Nn.sortedIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Ia(e[r],t))return r}return-1},Nn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return Kr(e,t,Xo(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gr(e,t,!0)-1;if(Ia(e[n],t))return n}return-1},Nn.startCase=Fl,Nn.startsWith=function(e,t,n){return e=sl(e),n=null==n?0:$n(ol(n),0,e.length),t=Xr(t),e.slice(n,n+t.length)==t},Nn.subtract=ms,Nn.sum=function(e){return e&&e.length?Dt(e,Kl):0},Nn.sumBy=function(e,t){return e&&e.length?Dt(e,Xo(t,2)):0},Nn.template=function(e,t,n){var r=Nn.templateSettings;n&&li(e,t,n)&&(t=void 0),e=sl(e),t=dl({},t,r,Ho);var o,i,a=dl({},t.imports,r.imports,Ho),l=bl(a),s=Nt(a,l),u=0,c=t.interpolate||se,d="__p += '",p=ve((t.escape||se).source+"|"+c.source+"|"+(c===H?ee:se).source+"|"+(t.evaluate||se).source+"|$","g"),f="//# sourceURL="+(_e.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pe+"]")+"\n";e.replace(p,function(t,n,r,a,l,s){return r||(r=a),d+=e.slice(u,s).replace(ue,Pt),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),l&&(i=!0,d+="';\n"+l+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+t.length,t}),d+="';\n";var m=_e.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(L,""):d).replace(k,"$1").replace(O,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=zl(function(){return pe(l,f+"return "+d).apply(void 0,s)});if(v.source=d,Ha(v))throw v;return v},Nn.times=function(e,t){if((e=ol(e))<1||e>9007199254740991)return[];var n=4294967295,r=ln(e,4294967295);e-=4294967295;for(var o=Ct(r,t=Xo(t));++n<e;)t(n);return o},Nn.toFinite=rl,Nn.toInteger=ol,Nn.toLength=il,Nn.toLower=function(e){return sl(e).toLowerCase()},Nn.toNumber=al,Nn.toSafeInteger=function(e){return e?$n(ol(e),-9007199254740991,9007199254740991):0===e?e:0},Nn.toString=sl,Nn.toUpper=function(e){return sl(e).toUpperCase()},Nn.trim=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return Tt(e);if(!e||!(t=Xr(t)))return e;var r=Wt(e),o=Wt(t);return so(r,It(r,o),Lt(r,o)+1).join("")},Nn.trimEnd=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.slice(0,qt(e)+1);if(!e||!(t=Xr(t)))return e;var r=Wt(e);return so(r,0,Lt(r,Wt(t))+1).join("")},Nn.trimStart=function(e,t,n){if((e=sl(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Xr(t)))return e;var r=Wt(e);return so(r,It(r,Wt(t))).join("")},Nn.truncate=function(e,t){var n=30,r="...";if(qa(t)){var o="separator"in t?t.separator:o;n="length"in t?ol(t.length):n,r="omission"in t?Xr(t.omission):r}var i=(e=sl(e)).length;if(Mt(e)){var a=Wt(e);i=a.length}if(n>=i)return e;var l=n-zt(r);if(l<1)return r;var s=a?so(a,0,l).join(""):e.slice(0,l);if(void 0===o)return s+r;if(a&&(l+=s.length-l),$a(o)){if(e.slice(l).search(o)){var u,c=s;for(o.global||(o=ve(o.source,sl(te.exec(o))+"g")),o.lastIndex=0;u=o.exec(c);)var d=u.index;s=s.slice(0,void 0===d?l:d)}}else if(e.indexOf(Xr(o),l)!=l){var p=s.lastIndexOf(o);p>-1&&(s=s.slice(0,p))}return s+r},Nn.unescape=function(e){return(e=sl(e))&&M.test(e)?e.replace(R,Vt):e},Nn.uniqueId=function(e){var t=++Ae;return sl(e)+t},Nn.upperCase=jl,Nn.upperFirst=Hl,Nn.each=sa,Nn.eachRight=ua,Nn.first=Mi,Zl(Nn,(ls={},sr(Nn,function(e,t){_e.call(Nn.prototype,t)||(ls[t]=e)}),ls),{chain:!1}),Nn.VERSION="4.17.21",rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nn[e].placeholder=Nn}),rt(["drop","take"],function(e,t){kn.prototype[e]=function(n){n=void 0===n?1:an(ol(n),0);var r=this.__filtered__&&!t?new kn(this):this.clone();return r.__filtered__?r.__takeCount__=ln(n,r.__takeCount__):r.__views__.push({size:ln(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},kn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;kn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),rt(["head","last"],function(e,t){var n="take"+(t?"Right":"");kn.prototype[e]=function(){return this[n](1).value()[0]}}),rt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");kn.prototype[e]=function(){return this.__filtered__?new kn(this):this[n](1)}}),kn.prototype.compact=function(){return this.filter(Kl)},kn.prototype.find=function(e){return this.filter(e).head()},kn.prototype.findLast=function(e){return this.reverse().find(e)},kn.prototype.invokeMap=Br(function(e,t){return"function"==typeof e?new kn(this):this.map(function(n){return yr(n,e,t)})}),kn.prototype.reject=function(e){return this.filter(Ca(Xo(e)))},kn.prototype.slice=function(e,t){e=ol(e);var n=this;return n.__filtered__&&(e>0||t<0)?new kn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ol(t))<0?n.dropRight(-t):n.take(t-e)),n)},kn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},kn.prototype.toArray=function(){return this.take(4294967295)},sr(kn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Nn[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(Nn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof kn,s=a[0],u=l||Ra(t),c=function(e){var t=o.apply(Nn,ct([e],a));return r&&d?t[0]:t};u&&n&&"function"==typeof s&&1!=s.length&&(l=u=!1);var d=this.__chain__,p=!!this.__actions__.length,f=i&&!d,m=l&&!p;if(!i&&u){t=m?t:new kn(this);var v=e.apply(t,a);return v.__actions__.push({func:ra,args:[c],thisArg:void 0}),new Ln(v,d)}return f&&m?e.apply(this,a):(v=this.thru(c),f?r?v.value()[0]:v.value():v)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ra(o)?o:[],e)}return this[n](function(n){return t.apply(Ra(n)?n:[],e)})}}),sr(kn.prototype,function(e,t){var n=Nn[t];if(n){var r=n.name+"";_e.call(En,r)||(En[r]=[]),En[r].push({name:t,func:n})}}),En[No(void 0,2).name]=[{name:"wrapper",func:void 0}],kn.prototype.clone=function(){var e=new kn(this.__wrapped__);return e.__actions__=go(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=go(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=go(this.__views__),e},kn.prototype.reverse=function(){if(this.__filtered__){var e=new kn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},kn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ra(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ln(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,l=i.end,s=l-a,u=r?l:a-1,c=this.__iteratees__,d=c.length,p=0,f=ln(s,this.__takeCount__);if(!n||!r&&o==s&&f==s)return to(e,this.__actions__);var m=[];e:for(;s--&&p<f;){for(var v=-1,h=e[u+=t];++v<d;){var g=c[v],y=g.type,E=(0,g.iteratee)(h);if(2==y)h=E;else if(!E){if(1==y)continue e;break e}}m[p++]=h}return m},Nn.prototype.at=oa,Nn.prototype.chain=function(){return na(this)},Nn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Nn.prototype.next=function(){void 0===this.__values__&&(this.__values__=nl(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,n=this;n instanceof In;){var r=wi(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof kn){var t=e;return this.__actions__.length&&(t=new kn(this)),(t=t.reverse()).__actions__.push({func:ra,args:[qi],thisArg:void 0}),new Ln(t,this.__chain__)}return this.thru(qi)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,_t&&(Nn.prototype[_t]=function(){return this}),Nn}();Ve?((Ve.exports=Gt)._=Gt,qe._=Gt):We._=Gt}).call(w)});const k=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],O=e=>{var i;let{searchParams:a,onFilterChange:s,defaultSearchParams:u,statusMap:p,moduleCode:f}=e,m=d(e,k);const{t:v}=o.useTranslation(),h=l.useQueryClient(),[g,y]=(Digit.ULBService.getCurrentTenantId(),Digit.UserService.getUser(),n.useState(()=>({services:(null==a?void 0:a.services)||["ADV"]}))),E=n.useMemo(()=>[{code:"ASSIGNED_TO_ME",name:v("ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:v("ASSIGNED_TO_ALL")}],[v]),S=E[1],[b,_]=n.useState(S),[A,D]=n.useState((null==a||null===(i=a.filters)||void 0===i?void 0:i.wfFilters)||{assignee:[{code:""}]}),C=(v("ADS_NEW_BOOKING_APPLICATION"),e=>{let t=e.delete,n=c({},g,e);t&&t.forEach(e=>delete n[e]),delete e.delete,y(c({},n))}),T=()=>{y(c({},u,{services:[]})),s(c({},u))};return r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading",style:{alignItems:"center"}},r.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},r.createElement("span",null,r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),r.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},v("ES_COMMON_FILTER_BY"),":")),r.createElement("div",{className:"clearAll",onClick:T},v("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&r.createElement("span",{className:"clear-search",onClick:T,style:{border:"1px solid #e0e0e0",padding:"6px"}},r.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&r.createElement("span",{onClick:m.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:e=>{_(e),D({uuid:e}),s(c({},g,{uuid:e}))},selectedOption:b,t:v,optionsKey:"name",options:E}),r.createElement("div",null,r.createElement(N,{searchParams:g,businessServices:["ADV"],statusMap:p||h.getQueryData("INBOX_STATUS_MAP_"+f),moduleCode:f,onAssignmentChange:(e,t)=>{C(e.target.checked?{applicationStatus:[...g.applicationStatus||[],t]}:{applicationStatus:null==g?void 0:g.applicationStatus.filter(e=>e.state!==t.state)})}})),r.createElement("div",null,r.createElement(t.SubmitBar,{onSubmit:()=>{s(c({},g,{wfFilters:A}))},label:v("ES_COMMON_APPLY")}))))))},R=e=>r.createElement("span",{className:"cell-text"},e),P=e=>r.createElement("span",{className:"sla-cell"},e),M=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];I(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:w,function(e,t){var n=[],r=Object.getPrototypeOf,o=n.slice,i=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,l=n.indexOf,s={},u=s.toString,c=s.hasOwnProperty,d=c.toString,p=d.call(Object),f={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},v=function(e){return null!=e&&e===e.window},h=e.document,g={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,n){var r,o,i=(n=n||h).createElement("script");if(i.text=e,t)for(r in g)(o=t[r]||t.getAttribute&&t.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function E(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[u.call(e)]||"object":typeof e}var S=function(e,t){return new S.fn.init(e,t)};function b(e){var t=!!e&&"length"in e&&e.length,n=E(e);return!m(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},l=1,s=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[l]||{},l++),"object"==typeof a||m(a)||(a={}),l===s&&(a=this,l--);l<s;l++)if(null!=(e=arguments[l]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(S.isPlainObject(r)||(o=Array.isArray(r)))?(n=a[t],i=o&&!Array.isArray(n)?[]:o||S.isPlainObject(n)?n:{},o=!1,a[t]=S.extend(u,i,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==u.call(e)||(t=r(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){y(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(b(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(b(Object(e))?S.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:l.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;r<n;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r=[],o=0,i=e.length,a=!n;o<i;o++)!t(e[o],o)!==a&&r.push(e[o]);return r},map:function(e,t,n){var r,o,a=0,l=[];if(b(e))for(r=e.length;a<r;a++)null!=(o=t(e[a],a,n))&&l.push(o);else for(a in e)null!=(o=t(e[a],a,n))&&l.push(o);return i(l)},guid:1,support:f}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()});var _=function(e){var t,n,r,o,i,a,l,s,u,c,d,p,f,m,v,h,g,y,E,S="sizzle"+1*new Date,b=e.document,_=0,A=0,D=se(),C=se(),T=se(),x=se(),N=function(e,t){return e===t&&(d=!0),0},w={}.hasOwnProperty,I=[],L=I.pop,k=I.push,O=I.push,R=I.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",j="\\["+B+"*("+F+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+B+"*\\]",H=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+j+")*)|.*)\\)|)",U=new RegExp(B+"+","g"),z=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),W=new RegExp("^"+B+"*,"+B+"*"),q=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),V=new RegExp(B+"|>"),G=new RegExp(H),K=new RegExp("^"+F+"$"),Y={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+j),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},$=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=function(){p()},ae=Se(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(I=R.call(b.childNodes),b.childNodes)}catch(e){O={apply:I.length?function(e,t){k.apply(e,R.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function le(e,t,r,o){var i,l,u,c,d,m,g,y=t&&t.ownerDocument,b=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return r;if(!o&&(p(t),t=t||f,v)){if(11!==b&&(d=Q.exec(e)))if(i=d[1]){if(9===b){if(!(u=t.getElementById(i)))return r;if(u.id===i)return r.push(u),r}else if(y&&(u=y.getElementById(i))&&E(t,u)&&u.id===i)return r.push(u),r}else{if(d[2])return O.apply(r,t.getElementsByTagName(e)),r;if((i=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(i)),r}if(n.qsa&&!x[e+" "]&&(!h||!h.test(e))&&(1!==b||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===b&&(V.test(e)||q.test(e))){for((y=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,oe):t.setAttribute("id",c=S)),l=(m=a(e)).length;l--;)m[l]=(c?"#"+c:":scope")+" "+Ee(m[l]);g=m.join(",")}try{return O.apply(r,y.querySelectorAll(g)),r}catch(t){x(e,!0)}finally{c===S&&t.removeAttribute("id")}}}return s(e.replace(z,"$1"),t,r,o)}function se(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function ue(e){return e[S]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ve(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return ue(function(t){return t=+t,ue(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=le.support={},i=le.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!$.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=le.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:b;return a!=f&&9===a.nodeType&&a.documentElement?(m=(f=a).documentElement,v=!i(f),b!=f&&(o=f.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),n.scope=ce(function(e){return m.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(f.getElementsByClassName),n.getById=ce(function(e){return m.appendChild(e).id=S,!f.getElementsByName||!f.getElementsByName(S).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&v){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&v)return t.getElementsByClassName(e)},g=[],h=[],(n.qsa=J.test(f.querySelectorAll))&&(ce(function(e){var t;m.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+B+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+S+"-]").length||h.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(y=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",H)}),h=h.length&&new RegExp(h.join("|")),g=g.length&&new RegExp(g.join("|")),t=J.test(m.compareDocumentPosition),E=t||J.test(m.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==b&&E(b,e)?-1:t==f||t.ownerDocument==b&&E(b,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],l=[t];if(!o||!i)return e==f?-1:t==f?1:o?-1:i?1:c?P(c,e)-P(c,t):0;if(o===i)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[r]===l[r];)r++;return r?pe(a[r],l[r]):a[r]==b?-1:l[r]==b?1:0},f):f},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&v&&!x[t+" "]&&(!g||!g.test(t))&&(!h||!h.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){x(t,!0)}return le(t,f,null,[e]).length>0},le.contains=function(e,t){return(e.ownerDocument||e)!=f&&p(e),E(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=f&&p(e);var o=r.attrHandle[t.toLowerCase()],i=o&&w.call(r.attrHandle,t.toLowerCase())?o(e,t,!v):void 0;return void 0!==i?i:n.attributes||!v?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},le.escape=function(e){return(e+"").replace(re,oe)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],o=0,i=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),d){for(;t=e[i++];)t===e[i]&&(o=r.push(i));for(;o--;)e.splice(r[o],1)}return c=null,e},o=le.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(r=le.selectors={cacheLength:50,createPseudo:ue,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=D[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&D(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=le.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,s){var u,c,d,p,f,m,v=i!==a?"nextSibling":"previousSibling",h=t.parentNode,g=l&&t.nodeName.toLowerCase(),y=!s&&!l,E=!1;if(h){if(i){for(;v;){for(p=t;p=p[v];)if(l?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;m=v="only"===e&&!m&&"nextSibling"}return!0}if(m=[a?h.firstChild:h.lastChild],a&&y){for(E=(f=(u=(c=(d=(p=h)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],p=f&&h.childNodes[f];p=++f&&p&&p[v]||(E=f=0)||m.pop();)if(1===p.nodeType&&++E&&p===t){c[e]=[_,f,E];break}}else if(y&&(E=f=(u=(c=(d=(p=t)[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===E)for(;(p=++f&&p&&p[v]||(E=f=0)||m.pop())&&((l?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++E||(y&&((c=(d=p[S]||(p[S]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[_,E]),p!==t)););return(E-=o)===r||E%r==0&&E/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return o[S]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)e[r=P(e,i[a])]=!(n[r]=i[a])}):function(e){return o(e,0,n)}):o}},pseudos:{not:ue(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[S]?ue(function(e,t,n,o){for(var i,a=r(e,null,o,[]),l=e.length;l--;)(i=a[l])&&(e[l]=!(t[l]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}}),has:ue(function(e){return function(t){return le(e,t).length>0}}),contains:ue(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||o(t)).indexOf(e)>-1}}),lang:ue(function(e){return K.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ve(!1),disabled:ve(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=me(t);function ye(){}function Ee(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Se(e,t,n){var r=t.dir,o=t.next,i=o||r,a=n&&"parentNode"===i,l=A++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,o);return!1}:function(t,n,s){var u,c,d,p=[_,l];if(s){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(d=t[S]||(t[S]={}))[t.uniqueID]||(d[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((u=c[i])&&u[0]===_&&u[1]===l)return p[2]=u[2];if(c[i]=p,p[2]=e(t,n,s))return!0}return!1}}function be(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function _e(e,t,n,r,o){for(var i,a=[],l=0,s=e.length,u=null!=t;l<s;l++)(i=e[l])&&(n&&!n(i,r,o)||(a.push(i),u&&t.push(l)));return a}function Ae(e,t,n,r,o,i){return r&&!r[S]&&(r=Ae(r)),o&&!o[S]&&(o=Ae(o,i)),ue(function(i,a,l,s){var u,c,d,p=[],f=[],m=a.length,v=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)le(e,t[r],n);return n}(t||"*",l.nodeType?[l]:l,[]),h=!e||!i&&t?v:_e(v,p,e,l,s),g=n?o||(i?e:m||r)?[]:a:h;if(n&&n(h,g,l,s),r)for(u=_e(g,f),r(u,[],l,s),c=u.length;c--;)(d=u[c])&&(g[f[c]]=!(h[f[c]]=d));if(i){if(o||e){if(o){for(u=[],c=g.length;c--;)(d=g[c])&&u.push(h[c]=d);o(null,g=[],u,s)}for(c=g.length;c--;)(d=g[c])&&(u=o?P(i,d):p[c])>-1&&(i[u]=!(a[u]=d))}}else g=_e(g===a?g.splice(m,g.length):g),o?o(null,a,g,s):O.apply(a,g)})}function De(e){for(var t,n,o,i=e.length,a=r.relative[e[0].type],l=a||r.relative[" "],s=a?1:0,c=Se(function(e){return e===t},l,!0),d=Se(function(e){return P(t,e)>-1},l,!0),p=[function(e,n,r){var o=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,o}];s<i;s++)if(n=r.relative[e[s].type])p=[Se(be(p),n)];else{if((n=r.filter[e[s].type].apply(null,e[s].matches))[S]){for(o=++s;o<i&&!r.relative[e[o].type];o++);return Ae(s>1&&be(p),s>1&&Ee(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(z,"$1"),n,s<o&&De(e.slice(s,o)),o<i&&De(e=e.slice(o)),o<i&&Ee(e))}p.push(n)}return be(p)}return ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=le.tokenize=function(e,t){var n,o,i,a,l,s,u,c=C[e+" "];if(c)return t?0:c.slice(0);for(l=e,s=[],u=r.preFilter;l;){for(a in n&&!(o=W.exec(l))||(o&&(l=l.slice(o[0].length)||l),s.push(i=[])),n=!1,(o=q.exec(l))&&(n=o.shift(),i.push({value:n,type:o[0].replace(z," ")}),l=l.slice(n.length)),r.filter)!(o=Y[a].exec(l))||u[a]&&!(o=u[a](o))||(n=o.shift(),i.push({value:n,type:a,matches:o}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):C(e,s).slice(0)},l=le.compile=function(e,t){var n,o=[],i=[],l=T[e+" "];if(!l){for(t||(t=a(e)),n=t.length;n--;)(l=De(t[n]))[S]?o.push(l):i.push(l);(l=T(e,function(e,t){var n=t.length>0,o=e.length>0,i=function(i,a,l,s,c){var d,m,h,g=0,y="0",E=i&&[],S=[],b=u,A=i||o&&r.find.TAG("*",c),D=_+=null==b?1:Math.random()||.1,C=A.length;for(c&&(u=a==f||a||c);y!==C&&null!=(d=A[y]);y++){if(o&&d){for(m=0,a||d.ownerDocument==f||(p(d),l=!v);h=e[m++];)if(h(d,a||f,l)){s.push(d);break}c&&(_=D)}n&&((d=!h&&d)&&g--,i&&E.push(d))}if(g+=y,n&&y!==g){for(m=0;h=t[m++];)h(E,S,a,l);if(i){if(g>0)for(;y--;)E[y]||S[y]||(S[y]=L.call(s));S=_e(S)}O.apply(s,S),c&&!i&&S.length>0&&g+t.length>1&&le.uniqueSort(s)}return c&&(_=D,u=b),E};return n?ue(i):i}(i,o))).selector=e}return l},s=le.select=function(e,t,n,o){var i,s,u,c,d,p="function"==typeof e&&e,f=!o&&a(e=p.selector||e);if(n=n||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(u=s[0]).type&&9===t.nodeType&&v&&r.relative[s[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(i=Y.needsContext.test(e)?0:s.length;i--&&!r.relative[c=(u=s[i]).type];)if((d=r.find[c])&&(o=d(u.matches[0].replace(te,ne),ee.test(s[0].type)&&ge(t.parentNode)||t))){if(s.splice(i,1),!(e=o.length&&Ee(s)))return O.apply(n,o),n;break}}return(p||l(e,f))(o,t,!v,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=S.split("").sort(N).join("")===S,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),le}(e);S.find=_,S.expr=_.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=_.uniqueSort,S.text=_.getText,S.isXMLDoc=_.isXML,S.contains=_.contains,S.escapeSelector=_.escape;var A=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&S(e).is(n))break;r.push(e)}return r},D=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},C=S.expr.match.needsContext;function T(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var x=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(e,t,n){return m(t)?S.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?S.grep(e,function(e){return e===t!==n}):"string"!=typeof t?S.grep(e,function(e){return l.call(t,e)>-1!==n}):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(o[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,o[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(N(this,e||[],!1))},not:function(e){return this.pushStack(N(this,e||[],!0))},is:function(e){return!!N(this,"string"==typeof e&&C.test(e)?S(e):e||[],!1).length}});var w,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||w,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(S.merge(this,S.parseHTML(r[1],(t=t instanceof S?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),x.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=h.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,w=S(h);var L=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,o=this.length,i=[],a="string"!=typeof e&&S(e);if(!C.test(e))for(;r<o;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?S.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?l.call(S(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,n){return A(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,n){return A(e,"nextSibling",n)},prevUntil:function(e,t,n){return A(e,"previousSibling",n)},siblings:function(e){return D((e.parentNode||{}).firstChild,e)},children:function(e){return D(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(T(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(e,t){S.fn[e]=function(n,r){var o=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=S.filter(r,o)),this.length>1&&(k[e]||S.uniqueSort(o),L.test(e)&&o.reverse()),this.pushStack(o)}});var R=/[^\x20\t\r\n\f]+/g;function P(e){return e}function M(e){throw e}function B(e,t,n,r){var o;try{e&&m(o=e.promise)?o.call(e).done(t).fail(n):e&&m(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(R)||[],function(e,n){t[n]=!0}),t}(e):S.extend({},e);var t,n,r,o,i=[],a=[],l=-1,s=function(){for(o=o||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l<i.length;)!1===i[l].apply(n[0],n[1])&&e.stopOnFalse&&(l=i.length,n=!1);e.memory||(n=!1),t=!1,o&&(i=n?[]:"")},u={add:function(){return i&&(n&&!t&&(l=i.length-1,a.push(n)),function t(n){S.each(n,function(n,r){m(r)?e.unique&&u.has(r)||i.push(r):r&&r.length&&"string"!==E(r)&&t(r)})}(arguments),n&&!t&&s()),this},remove:function(){return S.each(arguments,function(e,t){for(var n;(n=S.inArray(t,i,n))>-1;)i.splice(n,1),n<=l&&l--}),this},has:function(e){return e?S.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||s()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},S.extend({Deferred:function(t){var n=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return S.Deferred(function(t){S.each(n,function(n,r){var o=m(e[r[4]])&&e[r[4]];i[r[1]](function(){var e=o&&o.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,r,o){var i=0;function a(t,n,r,o){return function(){var l=this,s=arguments,u=function(){var e,u;if(!(t<i)){if((e=r.apply(l,s))===n.promise())throw new TypeError("Thenable self-resolution");m(u=e&&("object"==typeof e||"function"==typeof e)&&e.then)?o?u.call(e,a(i,n,P,o),a(i,n,M,o)):(i++,u.call(e,a(i,n,P,o),a(i,n,M,o),a(i,n,P,n.notifyWith))):(r!==P&&(l=void 0,s=[e]),(o||n.resolveWith)(l,s))}},c=o?u:function(){try{u()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,c.stackTrace),t+1>=i&&(r!==M&&(l=void 0,s=[e]),n.rejectWith(l,s))}};t?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),e.setTimeout(c))}}return S.Deferred(function(e){n[0][3].add(a(0,e,m(o)?o:P,e.notifyWith)),n[1][3].add(a(0,e,m(t)?t:P)),n[2][3].add(a(0,e,m(r)?r:M))}).promise()},promise:function(e){return null!=e?S.extend(e,o):o}},i={};return S.each(n,function(e,t){var a=t[2],l=t[5];o[t[1]]=a.add,l&&a.add(function(){r=l},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),i[t[0]]=function(){return i[t[0]+"With"](this===i?void 0:this,arguments),this},i[t[0]+"With"]=a.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=S.Deferred(),l=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(B(e,a.done(l(n)).resolve,a.reject,!t),"pending"===a.state()||m(i[n]&&i[n].then)))return a.then();for(;n--;)B(i[n],l(n),a.reject);return a.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&F.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout(function(){throw t})};var j=S.Deferred();function H(){h.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),S.ready()}S.fn.ready=function(e){return j.then(e).catch(function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||j.resolveWith(h,[S]))}}),S.ready.then=j.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(S.ready):(h.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var U=function(e,t,n,r,o,i,a){var l=0,s=e.length,u=null==n;if("object"===E(n))for(l in o=!0,n)U(e,t,l,n[l],!0,i,a);else if(void 0!==r&&(o=!0,m(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(S(e),n)})),t))for(;l<s;l++)t(e[l],n,a?r:r.call(e[l],l,t(e[l],n)));return o?e:u?t.call(e):s?t(e[0],n):i},z=/^-ms-/,W=/-([a-z])/g;function q(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(W,q)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=S.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,o=this.cache(e);if("string"==typeof t)o[V(t)]=n;else for(r in t)o[V(r)]=t[r];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new K,$=new K,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}$.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return $.hasData(e)||Y.hasData(e)},data:function(e,t,n){return $.access(e,t,n)},removeData:function(e,t){$.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===e){if(this.length&&(o=$.get(i),1===i.nodeType&&!Y.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=V(r.slice(5)),J(i,r,o[r]));Y.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){$.set(this,e)}):U(this,function(t){var n;if(i&&void 0===t)return void 0!==(n=$.get(i,e))||void 0!==(n=J(i,e))?n:void 0;this.each(function(){$.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){$.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return r=Y.get(e,t=(t||"fx")+"queue"),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){var n=S.queue(e,t=t||"fx"),r=n.length,o=n.shift(),i=S._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,function(){S.dequeue(e,t)},i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each(function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,o=S.Deferred(),i=this,a=this.length,l=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(i[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(l));return l(),o.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,re=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};ne.getRootNode&&(re=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ie=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&re(e)&&"none"===S.css(e,"display")};function ae(e,t,n,r){var o,i,a=20,l=r?function(){return r.cur()}:function(){return S.css(e,t,"")},s=l(),u=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==u&&+s)&&ee.exec(S.css(e,t));if(c&&c[3]!==u){for(u=u||c[3],c=+(s/=2)||1;a--;)S.style(e,t,c+u),(1-i)*(1-(i=l()/s||.5))<=0&&(a=0),c/=i;S.style(e,t,(c*=2)+u),n=n||[]}return n&&(c=+c||+s||0,o=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=o)),o}var le={};function se(e){var t,n=e.ownerDocument,r=e.nodeName,o=le[r];return o||(t=n.body.appendChild(n.createElement(r)),o=S.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),le[r]=o,o)}function ue(e,t){for(var n,r,o=[],i=0,a=e.length;i<a;i++)(r=e[i]).style&&(n=r.style.display,t?("none"===n&&(o[i]=Y.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&ie(r)&&(o[i]=se(r))):"none"!==n&&(o[i]="none",Y.set(r,"display",n)));for(i=0;i<a;i++)null!=o[i]&&(e[i].style.display=o[i]);return e}S.fn.extend({show:function(){return ue(this,!0)},hide:function(){return ue(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ie(this)?S(this).show():S(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,fe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),f.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",f.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",f.option=!!ce.lastChild;var ve={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&T(e,t)?S.merge([e],n):n}function ge(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ve.tbody=ve.tfoot=ve.colgroup=ve.caption=ve.thead,ve.th=ve.td,f.option||(ve.optgroup=ve.option=[1,"<select multiple='multiple'>","</select>"]);var ye=/<|&#?\w+;/;function Ee(e,t,n,r,o){for(var i,a,l,s,u,c,d=t.createDocumentFragment(),p=[],f=0,m=e.length;f<m;f++)if((i=e[f])||0===i)if("object"===E(i))S.merge(p,i.nodeType?[i]:i);else if(ye.test(i)){for(a=a||d.appendChild(t.createElement("div")),l=(fe.exec(i)||["",""])[1].toLowerCase(),a.innerHTML=(s=ve[l]||ve._default)[1]+S.htmlPrefilter(i)+s[2],c=s[0];c--;)a=a.lastChild;S.merge(p,a.childNodes),(a=d.firstChild).textContent=""}else p.push(t.createTextNode(i));for(d.textContent="",f=0;i=p[f++];)if(r&&S.inArray(i,r)>-1)o&&o.push(i);else if(u=re(i),a=he(d.appendChild(i),"script"),u&&ge(a),n)for(c=0;i=a[c++];)me.test(i.type||"")&&n.push(i);return d}var Se=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function _e(){return!1}function Ae(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function De(e,t,n,r,o,i){var a,l;if("object"==typeof t){for(l in"string"!=typeof n&&(r=r||n,n=void 0),t)De(e,l,n,r,t[l],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=_e;else if(!o)return e;return 1===i&&(a=o,(o=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,o,r,n)})}function Ce(e,t,n){n?(Y.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,i,a=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=o.call(arguments),Y.set(this,t,a),r=n(this,t),this[t](),a!==(i=Y.get(this,t))||r?Y.set(this,t,!1):i={},a!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else a.length&&(Y.set(this,t,{value:S.event.trigger(S.extend(a[0],S.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&S.event.add(e,t,be)}S.event={global:{},add:function(e,t,n,r,o){var i,a,l,s,u,c,d,p,f,m,v,h=Y.get(e);if(G(e))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&S.find.matchesSelector(ne,o),n.guid||(n.guid=S.guid++),(s=h.events)||(s=h.events=Object.create(null)),(a=h.handle)||(a=h.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(R)||[""]).length;u--;)f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f&&(d=S.event.special[f]||{},d=S.event.special[f=(o?d.delegateType:d.bindType)||f]||{},c=S.extend({type:f,origType:v,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&S.expr.match.needsContext.test(o),namespace:m.join(".")},i),(p=s[f])||((p=s[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,m,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[f]=!0)},remove:function(e,t,n,r,o){var i,a,l,s,u,c,d,p,f,m,v,h=Y.hasData(e)&&Y.get(e);if(h&&(s=h.events)){for(u=(t=(t||"").match(R)||[""]).length;u--;)if(f=v=(l=Se.exec(t[u])||[])[1],m=(l[2]||"").split(".").sort(),f){for(d=S.event.special[f]||{},p=s[f=(r?d.delegateType:d.bindType)||f]||[],l=l[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=p.length;i--;)c=p[i],!o&&v!==c.origType||n&&n.guid!==c.guid||l&&!l.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(i,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,h.handle)||S.removeEvent(e,f,h.handle),delete s[f])}else for(f in s)S.event.remove(e,f+t[u],n,r,!0);S.isEmptyObject(s)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,l=new Array(arguments.length),s=S.event.fix(e),u=(Y.get(this,"events")||Object.create(null))[s.type]||[],c=S.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=S.event.handlers.call(this,s,u),t=0;(o=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==i.namespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(r=((S.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,o,i,a,l=[],s=t.delegateCount,u=e.target;if(s&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(i=[],a={},n=0;n<s;n++)void 0===a[o=(r=t[n]).selector+" "]&&(a[o]=r.needsContext?S(o,this).index(u)>-1:S.find(o,this,null,[u]).length),a[o]&&i.push(r);i.length&&l.push({elem:u,handlers:i})}return u=this,s<t.length&&l.push({elem:u,handlers:t.slice(s)}),l},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click",be),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&T(t,"input")&&Ce(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&T(t,"input")&&Y.get(t,"click")||T(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:_e,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:_e,isPropagationStopped:_e,isImmediatePropagationStopped:_e,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ce(this,e,Ae),!1},trigger:function(){return Ce(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,i=e.handleObj;return o&&(o===r||S.contains(r,o))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),S.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=_e),this.each(function(){S.event.remove(this,e,n,t)})}});var Te=/<script|<style|<link/i,xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function we(e,t){return T(e,"table")&&T(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function ke(e,t){var n,r,o,i,a,l;if(1===t.nodeType){if(Y.hasData(e)&&(l=Y.get(e).events))for(o in Y.remove(t,"handle events"),l)for(n=0,r=l[o].length;n<r;n++)S.event.add(t,o,l[o][n]);$.hasData(e)&&(i=$.access(e),a=S.extend({},i),$.set(t,a))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=i(t);var o,a,l,s,u,c,d=0,p=e.length,v=p-1,h=t[0],g=m(h);if(g||p>1&&"string"==typeof h&&!f.checkClone&&xe.test(h))return e.each(function(o){var i=e.eq(o);g&&(t[0]=h.call(this,o,i.html())),Re(i,t,n,r)});if(p&&(a=(o=Ee(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=a),a||r)){for(s=(l=S.map(he(o,"script"),Ie)).length;d<p;d++)u=o,d!==v&&(u=S.clone(u,!0,!0),s&&S.merge(l,he(u,"script"))),n.call(e[d],u,d);if(s)for(c=l[l.length-1].ownerDocument,S.map(l,Le),d=0;d<s;d++)me.test((u=l[d]).type||"")&&!Y.access(u,"globalEval")&&S.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):y(u.textContent.replace(Ne,""),u,c))}return e}function Pe(e,t,n){for(var r,o=t?S.filter(t,e):e,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||S.cleanData(he(r)),r.parentNode&&(n&&re(r)&&ge(he(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,o,i,a,l=e.cloneNode(!0),s=re(e);if(!(f.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=he(l),r=0,o=(i=he(e)).length;r<o;r++)Oe(i[r],a[r]);if(t)if(n)for(i=i||he(e),a=a||he(l),r=0,o=i.length;r<o;r++)ke(i[r],a[r]);else ke(e,l);return(a=he(l,"script")).length>0&&ge(a,!s&&he(e,"script")),l},cleanData:function(e){for(var t,n,r,o=S.event.special,i=0;void 0!==(n=e[i]);i++)if(G(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)o[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[$.expando]&&(n[$.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Pe(this,e,!0)},remove:function(e){return Pe(this,e)},text:function(e){return U(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||we(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=we(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return U(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Te.test(e)&&!ve[(fe.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){S.fn[e]=function(e){for(var n,r=[],o=S(e),i=o.length-1,l=0;l<=i;l++)n=l===i?this:this.clone(!0),S(o[l])[t](n),a.apply(r,n.get());return this.pushStack(r)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Be=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=function(e,t,n){var r,o,i={};for(o in t)i[o]=e.style[o],e.style[o]=t[o];for(o in r=n.call(e),t)e.style[o]=i[o];return r},je=new RegExp(te.join("|"),"i");function He(e,t,n){var r,o,i,a,l=e.style;return(n=n||Be(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||re(e)||(a=S.style(e,t)),!f.pixelBoxStyles()&&Me.test(a)&&je.test(t)&&(r=l.width,o=l.minWidth,i=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=o,l.maxWidth=i)),void 0!==a?a+"":a}function Ue(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,s=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),o=36===n(t.width),c.style.position="absolute",i=12===n(c.offsetWidth/3),ne.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,o,i,a,l,s,u=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(f,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,n,r,o;return null==l&&(t=h.createElement("table"),n=h.createElement("tr"),r=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",ne.appendChild(t).appendChild(n).appendChild(r),o=e.getComputedStyle(n),l=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),l}}))}();var ze=["Webkit","Moz","ms"],We=h.createElement("div").style,qe={};function Ve(e){return S.cssProps[e]||qe[e]||(e in We?e:qe[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=ze.length;n--;)if((e=ze[n]+t)in We)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ke=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},$e={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var r=ee.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,o,i){var a="width"===t?1:0,l=0,s=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(s+=S.css(e,n+te[a],!0,o)),r?("content"===n&&(s-=S.css(e,"padding"+te[a],!0,o)),"margin"!==n&&(s-=S.css(e,"border"+te[a]+"Width",!0,o))):(s+=S.css(e,"padding"+te[a],!0,o),"padding"!==n?s+=S.css(e,"border"+te[a]+"Width",!0,o):l+=S.css(e,"border"+te[a]+"Width",!0,o));return!r&&i>=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-s-l-.5))||0),s}function Je(e,t,n){var r=Be(e),o=(!f.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),i=o,a=He(e,t,r),l="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!f.boxSizingReliable()&&o||!f.reliableTrDimensions()&&T(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===S.css(e,"boxSizing",!1,r),(i=l in e)&&(a=e[l])),(a=parseFloat(a)||0)+Ze(e,t,n||(o?"border":"content"),i,r,a)+"px"}function Qe(e,t,n,r,o){return new Qe.prototype.init(e,t,n,r,o)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=He(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,l=V(t),s=Ke.test(t),u=e.style;if(s||(t=Ve(l)),a=S.cssHooks[t]||S.cssHooks[l],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:u[t];"string"==(i=typeof n)&&(o=ee.exec(n))&&o[1]&&(n=ae(e,t,o),i="number"),null!=n&&n==n&&("number"!==i||s||(n+=o&&o[3]||(S.cssNumber[l]?"":"px")),f.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(s?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var o,i,a,l=V(t);return Ke.test(t)||(t=Ve(l)),(a=S.cssHooks[t]||S.cssHooks[l])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=He(e,t,r)),"normal"===o&&t in $e&&(o=$e[t]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),S.each(["height","width"],function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,r):Fe(e,Ye,function(){return Je(e,t,r)})},set:function(e,n,r){var o,i=Be(e),a=!f.scrollboxSize()&&"absolute"===i.position,l=(a||r)&&"border-box"===S.css(e,"boxSizing",!1,i),s=r?Ze(e,t,r,l,i):0;return l&&a&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-Ze(e,t,"border",!1,i)-.5)),s&&(o=ee.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),Xe(0,n,s)}}}),S.cssHooks.marginLeft=Ue(f.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+te[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(S.cssHooks[e+t].set=Xe)}),S.fn.extend({css:function(e,t){return U(this,function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=Be(e),o=t.length;a<o;a++)i[t[a]]=S.css(e,t[a],!1,r);return i}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,arguments.length>1)}}),S.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(S.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Qe.prototype.init,S.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,rt=/queueHooks$/;function ot(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(ot):e.setTimeout(ot,S.fx.interval),S.fx.tick())}function it(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function at(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=te[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function lt(e,t,n){for(var r,o=(st.tweeners[t]||[]).concat(st.tweeners["*"]),i=0,a=o.length;i<a;i++)if(r=o[i].call(n,t,e))return r}function st(e,t,n){var r,o,i=0,a=st.prefilters.length,l=S.Deferred().always(function(){delete s.elem}),s=function(){if(o)return!1;for(var t=et||it(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),i=0,a=u.tweens.length;i<a;i++)u.tweens[i].run(r);return l.notifyWith(e,[u,r,n]),r<1&&a?n:(a||l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u]),!1)},u=l.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||it(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)u.tweens[n].run(1);return t?(l.notifyWith(e,[u,1,0]),l.resolveWith(e,[u,t])):l.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,o,i,a;for(n in e)if(o=t[r=V(n)],i=e[n],Array.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in i=a.expand(i),delete e[r],i)n in e||(e[n]=i[n],t[n]=o);else t[r]=o}(c,u.opts.specialEasing);i<a;i++)if(r=st.prefilters[i].call(u,e,c,u.opts))return m(r.stop)&&(S._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return S.map(c,lt,u),m(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),S.fx.timer(S.extend(s,{elem:e,anim:u,queue:u.opts.queue})),u}S.Animation=S.extend(st,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ae(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,o=e.length;r<o;r++)(st.tweeners[n=e[r]]=st.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var r,o,i,a,l,s,u,c,d="width"in t||"height"in t,p=this,f={},m=e.style,v=e.nodeType&&ie(e),h=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(nt.test(o=t[r])){if(delete t[r],i=i||"toggle"===o,o===(v?"hide":"show")){if("show"!==o||!h||void 0===h[r])continue;v=!0}f[r]=h&&h[r]||S.style(e,r)}if((s=!S.isEmptyObject(t))||!S.isEmptyObject(f))for(r in d&&1===e.nodeType&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],null==(u=h&&h.display)&&(u=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(u?c=u:(ue([e],!0),u=e.style.display||u,c=S.css(e,"display"),ue([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===S.css(e,"float")&&(s||(p.done(function(){m.display=u}),null==u&&(u="none"===(c=m.display)?"":c)),m.display="inline-block")),n.overflow&&(m.overflow="hidden",p.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]})),s=!1,f)s||(h?"hidden"in h&&(v=h.hidden):h=Y.access(e,"fxshow",{display:u}),i&&(h.hidden=!v),v&&ue([e],!0),p.done(function(){for(r in v||ue([e]),Y.remove(e,"fxshow"),f)S.style(e,r,f[r])})),s=lt(v?h[r]:0,r,p),r in h||(h[r]=s.start,v&&(s.end=s.start,s.start=0))}],prefilter:function(e,t){t?st.prefilters.unshift(e):st.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration=r.duration in S.fx.speeds?S.fx.speeds[r.duration]:S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ie).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=S.isEmptyObject(e),i=S.speed(t,n,r),a=function(){var t=st(this,S.extend({},e),i);(o||Y.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||!1===i.queue?this.each(a):this.queue(i.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",i=S.timers,a=Y.get(this);if(o)a[o]&&a[o].stop&&r(a[o]);else for(o in a)a[o]&&a[o].stop&&rt.test(o)&&r(a[o]);for(o=i.length;o--;)i[o].elem!==this||null!=e&&i[o].queue!==e||(i[o].anim.stop(n),t=!1,i.splice(o,1));!t&&n||S.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Y.get(this),r=n[e+"queue"],o=n[e+"queueHooks"],i=S.timers,a=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),S.each(["toggle","show","hide"],function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(at(t,!0),e,r,o)}}),S.each({slideDown:at("show"),slideUp:at("hide"),slideToggle:at("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),et=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){tt||(tt=!0,ot())},S.fx.stop=function(){tt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,r){var o=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(o)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",f.checkOn=""!==e.value,f.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",f.radioValue="t"===e.value}();var ut,ct=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return U(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?S.prop(e,t,n):(1===i&&S.isXMLDoc(e)||(o=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ut:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!f.radioValue&&"radio"===t&&T(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(R);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),ut={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||S.find.attr;ct[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=ct[a],ct[a]=o,o=null!=n(e,t,r)?a:null,ct[a]=i),o}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function ft(e){return(e.match(R)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}S.fn.extend({prop:function(e,t){return U(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(e)||(o=S.propHooks[t=S.propFix[t]||t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(S.propHooks.selected={get:function(e){return null},set:function(e){}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(e){var t,n,r,o,i,a,l,s=0;if(m(e))return this.each(function(t){S(this).addClass(e.call(this,t,mt(this)))});if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},removeClass:function(e){var t,n,r,o,i,a,l,s=0;if(m(e))return this.each(function(t){S(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=vt(e)).length)for(;n=this[s++];)if(o=mt(n),r=1===n.nodeType&&" "+ft(o)+" "){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(l=ft(r))&&n.setAttribute("class",l)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(n){S(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,o,i,a;if(r)for(o=0,i=S(this),a=vt(e);t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||((t=mt(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+ft(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;S.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=m(e),this.each(function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,S(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=S.map(o,function(e){return null==e?"":e+""})),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=S.valHooks[o.type]||S.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(ht,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ft(S.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,l=a?null:[],s=a?i+1:o.length;for(r=i<0?s:a?i:0;r<s;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!T(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;l.push(t)}return l},set:function(e,t){for(var n,r,o=e.options,i=S.makeArray(t),a=o.length;a--;)((r=o[a]).selected=S.inArray(S.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},f.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),f.focusin="onfocusin"in e;var gt=/^(?:focusinfocus|focusoutblur)$/,yt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,r,o){var i,a,l,s,u,d,p,f,g=[r||h],y=c.call(t,"type")?t.type:t,E=c.call(t,"namespace")?t.namespace.split("."):[];if(a=f=l=r=r||h,3!==r.nodeType&&8!==r.nodeType&&!gt.test(y+S.event.triggered)&&(y.indexOf(".")>-1&&(E=y.split("."),y=E.shift(),E.sort()),u=y.indexOf(":")<0&&"on"+y,(t=t[S.expando]?t:new S.Event(y,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=E.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+E.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:S.makeArray(n,[t]),p=S.event.special[y]||{},o||!p.trigger||!1!==p.trigger.apply(r,n))){if(!o&&!p.noBubble&&!v(r)){for(gt.test((s=p.delegateType||y)+y)||(a=a.parentNode);a;a=a.parentNode)g.push(a),l=a;l===(r.ownerDocument||h)&&g.push(l.defaultView||l.parentWindow||e)}for(i=0;(a=g[i++])&&!t.isPropagationStopped();)f=a,t.type=i>1?s:p.bindType||y,(d=(Y.get(a,"events")||Object.create(null))[t.type]&&Y.get(a,"handle"))&&d.apply(a,n),(d=u&&a[u])&&d.apply&&G(a)&&(t.result=d.apply(a,n),!1===t.result&&t.preventDefault());return t.type=y,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(g.pop(),n)||!G(r)||u&&m(r[y])&&!v(r)&&((l=r[u])&&(r[u]=null),S.event.triggered=y,t.isPropagationStopped()&&f.addEventListener(y,yt),r[y](),t.isPropagationStopped()&&f.removeEventListener(y,yt),S.event.triggered=void 0,l&&(r[u]=l)),t.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),f.focusin||S.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,o=Y.access(r,t);o||r.addEventListener(e,n,!0),Y.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=Y.access(r,t)-1;o?Y.access(r,t,o):(r.removeEventListener(e,n,!0),Y.remove(r,t))}}});var Et=e.location,St={guid:Date.now()},bt=/\?/;S.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var _t=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;function Tt(e,t,n,r){var o;if(Array.isArray(t))S.each(t,function(t,o){n||_t.test(e)?r(e,o):Tt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==E(t))r(e,t);else for(o in t)Tt(e+"["+o+"]",t[o],n,r)}S.param=function(e,t){var n,r=[],o=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){o(this.name,this.value)});else for(n in e)Tt(n,e[n],t,o);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Ct.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var xt=/%20/g,Nt=/#.*$/,wt=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,kt=/^\/\//,Ot={},Rt={},Pt="*/".concat("*"),Mt=h.createElement("a");function Bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(R)||[];if(m(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ft(e,t,n,r){var o={},i=e===Rt;function a(l){var s;return o[l]=!0,S.each(e[l]||[],function(e,l){var u=l(t,n,r);return"string"!=typeof u||i||o[u]?i?!(s=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),s}return a(t.dataTypes[0])||!o["*"]&&a("*")}function jt(e,t){var n,r,o=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=Et.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?jt(jt(e,S.ajaxSettings),t):jt(S.ajaxSettings,e)},ajaxPrefilter:Bt(Ot),ajaxTransport:Bt(Rt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var r,o,i,a,l,s,u,c,d,p,f=S.ajaxSetup({},n=n||{}),m=f.context||f,v=f.context&&(m.nodeType||m.jquery)?S(m):S.event,g=S.Deferred(),y=S.Callbacks("once memory"),E=f.statusCode||{},b={},_={},A="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=It.exec(i);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?i:null},setRequestHeader:function(e,t){return null==u&&(e=_[e.toLowerCase()]=_[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)D.always(e[D.status]);else for(t in e)E[t]=[E[t],e[t]];return this},abort:function(e){var t=e||A;return r&&r.abort(t),C(0,t),this}};if(g.promise(D),f.url=((t||f.url||Et.href)+"").replace(kt,Et.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(R)||[""],null==f.crossDomain){s=h.createElement("a");try{s.href=f.url,s.href=s.href,f.crossDomain=Mt.protocol+"//"+Mt.host!=s.protocol+"//"+s.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),Ft(Ot,f,n,D),u)return D;for(d in(c=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Lt.test(f.type),o=f.url.replace(Nt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(xt,"+")):(p=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(bt.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(wt,"$1"),p=(bt.test(o)?"&":"?")+"_="+St.guid+++p),f.url=o+p),f.ifModified&&(S.lastModified[o]&&D.setRequestHeader("If-Modified-Since",S.lastModified[o]),S.etag[o]&&D.setRequestHeader("If-None-Match",S.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&D.setRequestHeader("Content-Type",f.contentType),D.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Pt+"; q=0.01":""):f.accepts["*"]),f.headers)D.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(m,D,f)||u))return D.abort();if(A="abort",y.add(f.complete),D.done(f.success),D.fail(f.error),r=Ft(Rt,f,n,D)){if(D.readyState=1,c&&v.trigger("ajaxSend",[D,f]),u)return D;f.async&&f.timeout>0&&(l=e.setTimeout(function(){D.abort("timeout")},f.timeout));try{u=!1,r.send(b,C)}catch(e){if(u)throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,n,a,s){var d,p,h,b,_,A=n;u||(u=!0,l&&e.clearTimeout(l),r=void 0,i=s||"",D.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(b=function(e,t,n){for(var r,o,i,a,l=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){s.unshift(o);break}if(s[0]in n)i=s[0];else{for(o in n){if(!s[0]||e.converters[o+" "+s[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==s[0]&&s.unshift(i),n[i]}(f,D,a)),!d&&S.inArray("script",f.dataTypes)>-1&&S.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(e,t,n,r){var o,i,a,l,s,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(i=c.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!s&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=i,i=c.shift())if("*"===i)i=s;else if("*"!==s&&s!==i){if(!(a=u[s+" "+i]||u["* "+i]))for(o in u)if((l=o.split(" "))[1]===i&&(a=u[s+" "+l[0]]||u["* "+l[0]])){!0===a?a=u[o]:!0!==u[o]&&(i=l[0],c.unshift(l[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+s+" to "+i}}}return{state:"success",data:t}}(f,b,D,d),d?(f.ifModified&&((_=D.getResponseHeader("Last-Modified"))&&(S.lastModified[o]=_),(_=D.getResponseHeader("etag"))&&(S.etag[o]=_)),204===t||"HEAD"===f.type?A="nocontent":304===t?A="notmodified":(A=b.state,p=b.data,d=!(h=b.error))):(h=A,!t&&A||(A="error",t<0&&(t=0))),D.status=t,D.statusText=(n||A)+"",d?g.resolveWith(m,[p,A,D]):g.rejectWith(m,[D,A,h]),D.statusCode(E),E=void 0,c&&v.trigger(d?"ajaxSuccess":"ajaxError",[D,f,d?p:h]),y.fireWith(m,[D,A]),c&&(v.trigger("ajaxComplete",[D,f]),--S.active||S.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,t){S[t]=function(e,n,r,o){return m(n)&&(o=o||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:o,data:n,success:r},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){S(this).wrapInner(e.call(this,t))}):this.each(function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){S(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},Ut=S.ajaxSettings.xhr();f.cors=!!Ut&&"withCredentials"in Ut,f.ajax=Ut=!!Ut,S.ajaxTransport(function(t){var n,r;if(f.cors||Ut&&!t.crossDomain)return{send:function(o,i){var a,l=t.xhr();if(l.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)l[a]=t.xhrFields[a];for(a in t.mimeType&&l.overrideMimeType&&l.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)l.setRequestHeader(a,o[a]);n=function(e){return function(){n&&(n=r=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===e?l.abort():"error"===e?"number"!=typeof l.status?i(0,"error"):i(l.status,l.statusText):i(Ht[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=n(),r=l.onerror=l.ontimeout=n("error"),void 0!==l.onabort?l.onabort=r:l.onreadystatechange=function(){4===l.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{l.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var zt,Wt=[],qt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Wt.pop()||S.expando+"_"+St.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(t,n,r){var o,i,a,l=!1!==t.jsonp&&(qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&qt.test(t.data)&&"data");if(l||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,l?t[l]=t[l].replace(qt,"$1"+o):!1!==t.jsonp&&(t.url+=(bt.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return a||S.error(o+" was not called"),a[0]},t.dataTypes[0]="json",i=e[o],e[o]=function(){a=arguments},r.always(function(){void 0===i?S(e).removeProp(o):e[o]=i,t[o]&&(t.jsonpCallback=n.jsonpCallback,Wt.push(o)),a&&m(i)&&i(a[0]),a=i=void 0}),"script"}),f.createHTMLDocument=((zt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===zt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(f.createHTMLDocument?((r=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(r)):t=h),i=!n&&[],(o=x.exec(e))?[t.createElement(o[1])]:(o=Ee([e],t,i),i&&i.length&&S(i).remove(),S.merge([],o.childNodes)));var r,o,i},S.fn.load=function(e,t,n){var r,o,i,a=this,l=e.indexOf(" ");return l>-1&&(r=ft(e.slice(l)),e=e.slice(0,l)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&S.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done(function(e){i=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,function(t){return e===t.elem}).length},S.offset={setOffset:function(e,t,n){var r,o,i,a,l,s,u=S.css(e,"position"),c=S(e),d={};"static"===u&&(e.style.position="relative"),l=c.offset(),i=S.css(e,"top"),s=S.css(e,"left"),("absolute"===u||"fixed"===u)&&(i+s).indexOf("auto")>-1?(a=(r=c.position()).top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(s)||0),m(t)&&(t=t.call(e,n,S.extend({},l))),null!=t.top&&(d.top=t.top-l.top+a),null!=t.left&&(d.left=t.left-l.left+o),"using"in t?t.using.call(e,d):c.css(d)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){S.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?{top:(t=r.getBoundingClientRect()).top+(n=r.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],o={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((o=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),o.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-S.css(r,"marginTop",!0),left:t.left-o.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ne})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return U(this,function(e,r,o){var i;if(v(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===o)return i?i[t]:e[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):e[r]=o},e,r,arguments.length)}}),S.each(["top","left"],function(e,t){S.cssHooks[t]=Ue(f.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?S(e).position()[t]+"px":n})}),S.each({Height:"height",Width:"width"},function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){S.fn[r]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),l=n||(!0===o||!0===i?"margin":"border");return U(this,function(t,n,o){var i;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===o?S.css(t,n,l):S.style(t,n,o,l)},t,a?o:void 0,a)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=o.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(o.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=T,S.isFunction=m,S.isWindow=v,S.camelCase=V,S.type=E,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Vt,"")};var Gt=e.jQuery,Kt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=Kt),t&&e.jQuery===S&&(e.jQuery=Gt),S},void 0===t&&(e.jQuery=e.$=S),S})});const B=e=>{let{className:t,onClick:n}=e;return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#1359C8",className:t,width:"24px",height:"24px",onClick:n},r.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),r.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))},F="__googleMapsScriptId";var j;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(j||(j={}));class H{constructor(e){let{apiKey:t,channel:n,client:r,id:o=F,libraries:i=[],language:a,region:l,version:s,mapIds:u,nonce:c,retries:d=3,url:p="https://maps.googleapis.com/maps/api/js"}=e;if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=s,this.apiKey=t,this.channel=n,this.client=r,this.id=o||F,this.libraries=i,this.language=a,this.region=l,this.mapIds=u,this.nonce=c,this.retries=d,this.url=p,H.instance){if(!function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}(this.options,H.instance.options))throw new Error("Loader must not be called again with different options. "+JSON.stringify(this.options)+" !== "+JSON.stringify(H.instance.options));return H.instance}H.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}get status(){return this.errors.length?j.FAILURE:this.done?j.SUCCESS:this.loading?j.LOADING:j.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),this.libraries.length>0&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="®ion="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(n=>{n?t(n.error):e(window.google)})})}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const e=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=e,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in "+e+" ms."),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}const U="undefined"!=typeof window&&window.google?window.google:null,z=e=>{let t={};const o=e=>{var t;let n=null;return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("postal_code");n=t?e.long_name:null}),n},i=[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],a=function(e,t,n){void 0===n&&(n=!1),(new U.maps.Geocoder).geocode({location:e},function(r,i){if("OK"===i&&r[0]){let i=o(r[0]);const a=document.getElementById("pac-input");a.value=(e=>{var t;let n="";return null==e||null===(t=e.address_components)||void 0===t||t.forEach(e=>{let t=e.types.includes("sublocality_level_2")||e.types.includes("sublocality_level_1");t&&(n=t?e.long_name:null)}),n})(r[0]),t&&(n?t(i,{longitude:e.lng,latitude:e.lat},a.value):t(i,{longitude:e.lng,latitude:e.lat}))}})},l=function(e,t,n){if(!e)return;const{latLng:r}=e,o={lat:r.lat(),lng:r.lng()};t("000000",{longitude:o.lng,latitude:o.lat})},s=function(e,n,r){void 0===r&&(r=!1);const s=new window.google.maps.Map(document.getElementById("map"),{center:n,zoom:15,mapTypeId:"roadmap",styles:i}),u=document.getElementById("pac-input");var c;u&&u.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}),(c=n).lat&&c.lng&&(t={north:c.lat+.1,south:c.lat-.1,east:c.lng+.1,west:c.lng-.1});const d=new window.google.maps.places.Autocomplete(u,{bounds:t,componentRestrictions:{country:"in"},fields:["address_components","geometry","icon","name"],origin:n,strictBounds:!1,types:["address"]});s.addListener("bounds_changed",()=>{d.setBounds(s.getBounds())});let p=[new window.google.maps.Marker({map:s,title:"a",position:n,draggable:!0,clickable:!0})];r?a(n,e,!0):a(n,e),p[0].addListener("dragend",t=>l(t,e)),d.addListener("place_changed",()=>{const t=d.getPlace();if(!t)return;let n=o(t);if(n){const{geometry:o}=t,i={latitude:o.location.lat(),longitude:o.location.lng()};r?e(n,i,t.name):e(n,i)}p.forEach(e=>{e.setMap(null)}),p=[];const i=new window.google.maps.LatLngBounds;t.geometry&&(p.push(new window.google.maps.Marker({map:s,title:t.name,position:t.geometry.location,draggable:!0,clickable:!0})),p[0].addListener("dragend",t=>l(t,e)),t.geometry.viewport?i.union(t.geometry.viewport):i.extend(t.geometry.location),s.fitBounds(i))})};return n.useEffect(()=>{!function(){try{const t=t=>{s(e.onChange,{lat:t.coords.latitude,lng:t.coords.longitude},e.isPlaceRequired)},n=t=>{let n={};var r;n=null!=e&&e.isPTDefault&&(null==e||null===(r=e.PTdefaultcoord)||void 0===r?void 0:r.defaultConfig)||{lat:31.6160638,lng:74.8978579},s(e.onChange,n,e.isPlaceRequired)};(e=>{var t;const n=null===(t=window.globalConfigs)||void 0===t?void 0:t.getConfig("GMAPS_API_KEY");new H({apiKey:n,version:"weekly",libraries:["places"]}).load().then(()=>{e&&e()}).catch(e=>{})})(()=>{var r,o,i;null!==(r=e.position)&&void 0!==r&&r.latitude&&null!==(o=e.position)&&void 0!==o&&o.longitude?t({coords:e.position}):null!==(i=navigator)&&void 0!==i&&i.geolocation?navigator.geolocation.getCurrentPosition(t,n):n()}),Promise.resolve()}catch(e){return Promise.reject(e)}}()},[]),r.createElement("div",{className:"map-wrap"},r.createElement("div",{className:"map-search-bar-wrap"},r.createElement(B,{className:"map-search-bar-icon"}),r.createElement("input",{id:"pac-input",className:"map-search-bar",type:"text",placeholder:"Search Address",style:{backgroundPosition:"left",color:"#222",caretColor:"#222"},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}})),r.createElement("div",{id:"map",className:"map"}))};var W="function"==typeof Symbol&&Symbol.for,q=W?Symbol.for("react.element"):60103,V=W?Symbol.for("react.portal"):60106,G=W?Symbol.for("react.fragment"):60107,K=W?Symbol.for("react.strict_mode"):60108,Y=W?Symbol.for("react.profiler"):60114,$=W?Symbol.for("react.provider"):60109,X=W?Symbol.for("react.context"):60110,Z=W?Symbol.for("react.async_mode"):60111,J=W?Symbol.for("react.concurrent_mode"):60111,Q=W?Symbol.for("react.forward_ref"):60112,ee=W?Symbol.for("react.suspense"):60113,te=W?Symbol.for("react.suspense_list"):60120,ne=W?Symbol.for("react.memo"):60115,re=W?Symbol.for("react.lazy"):60116,oe=W?Symbol.for("react.block"):60121,ie=W?Symbol.for("react.fundamental"):60117,ae=W?Symbol.for("react.responder"):60118,le=W?Symbol.for("react.scope"):60119;function se(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case q:switch(e=e.type){case Z:case J:case G:case Y:case K:case ee:return e;default:switch(e=e&&e.$$typeof){case X:case Q:case re:case ne:case $:return e;default:return t}}case V:return t}}}function ue(e){return se(e)===J}var ce={AsyncMode:Z,ConcurrentMode:J,ContextConsumer:X,ContextProvider:$,Element:q,ForwardRef:Q,Fragment:G,Lazy:re,Memo:ne,Portal:V,Profiler:Y,StrictMode:K,Suspense:ee,isAsyncMode:function(e){return ue(e)||se(e)===Z},isConcurrentMode:ue,isContextConsumer:function(e){return se(e)===X},isContextProvider:function(e){return se(e)===$},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===q},isForwardRef:function(e){return se(e)===Q},isFragment:function(e){return se(e)===G},isLazy:function(e){return se(e)===re},isMemo:function(e){return se(e)===ne},isPortal:function(e){return se(e)===V},isProfiler:function(e){return se(e)===Y},isStrictMode:function(e){return se(e)===K},isSuspense:function(e){return se(e)===ee},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===G||e===J||e===Y||e===K||e===ee||e===te||"object"==typeof e&&null!==e&&(e.$$typeof===re||e.$$typeof===ne||e.$$typeof===$||e.$$typeof===X||e.$$typeof===Q||e.$$typeof===ie||e.$$typeof===ae||e.$$typeof===le||e.$$typeof===oe)},typeOf:se},de=I(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,E=e?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var f=e.type;switch(f){case u:case c:case o:case a:case i:case p:return f;default:var h=f&&f.$$typeof;switch(h){case s:case d:case v:case m:case l:return h;default:return t}}case r:return t}}}var b=c,_=s,A=l,D=n,C=d,T=o,x=v,N=m,w=r,I=a,L=i,k=p,O=!1;function R(e){return S(e)===c}t.AsyncMode=u,t.ConcurrentMode=b,t.ContextConsumer=_,t.ContextProvider=A,t.Element=D,t.ForwardRef=C,t.Fragment=T,t.Lazy=x,t.Memo=N,t.Portal=w,t.Profiler=I,t.StrictMode=L,t.Suspense=k,t.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||S(e)===u},t.isConcurrentMode=R,t.isContextConsumer=function(e){return S(e)===s},t.isContextProvider=function(e){return S(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return S(e)===d},t.isFragment=function(e){return S(e)===o},t.isLazy=function(e){return S(e)===v},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===r},t.isProfiler=function(e){return S(e)===a},t.isStrictMode=function(e){return S(e)===i},t.isSuspense=function(e){return S(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===c||e===a||e===i||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===s||e.$$typeof===d||e.$$typeof===g||e.$$typeof===y||e.$$typeof===E||e.$$typeof===h)},t.typeOf=S}()}),pe=I(function(e){e.exports="production"===process.env.NODE_ENV?ce:de}),fe=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;function he(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ge=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=he(e),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))me.call(n,a)&&(o[a]=n[a]);if(fe){r=fe(n);for(var l=0;l<r.length;l++)ve.call(n,r[l])&&(o[r[l]]=n[r[l]])}}return o},ye="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Ee=Function.call.bind(Object.prototype.hasOwnProperty),Se=function(){};if("production"!==process.env.NODE_ENV){var be=ye,_e={},Ae=Ee;Se=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function De(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(Ae(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,r,n,null,be)}catch(e){a=e}if(!a||a instanceof Error||Se((r||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in _e)){_e[a.message]=!0;var s=o?o():"";Se("Failed "+n+" type: "+a.message+(null!=s?s:""))}}}De.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(_e={})};var Ce=De,Te=function(){};function xe(){return null}function Ne(){}function we(){}"production"!==process.env.NODE_ENV&&(Te=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),we.resetWarningCache=Ne;var Ie=I(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(xe),arrayOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var l=t[n];if(!Array.isArray(l))return new i("Invalid "+o+" `"+a+"` of type `"+c(l)+"` supplied to `"+r+"`, expected an array.");for(var s=0;s<l.length;s++){var u=e(l,s,r,o,a+"["+s+"]",ye);if(u instanceof Error)return u}return null})},element:a(function(t,n,r,o,a){var l=t[n];return e(l)?null:new i("Invalid "+o+" `"+a+"` of type `"+c(l)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,o){var a=e[t];return pe.isValidElementType(a)?null:new i("Invalid "+r+" `"+o+"` of type `"+c(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,o,a){var l;return t[n]instanceof e?null:new i("Invalid "+o+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,o){return u(e[t])?null:new i("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var l=t[n],s=c(l);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var u in l)if(Ee(l,u)){var d=e(l,u,r,o,a+"."+u,ye);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Te(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),xe;function t(t,n,r,a,l){for(var s=t[n],u=0;u<e.length;u++)if(o(s,e[u]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+c+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&Te("Invalid argument supplied to oneOfType, expected an instance of array."),xe;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return Te("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(n)+" at index "+t+"."),xe}return a(function(t,n,r,o,a){for(var l=[],s=0;s<e.length;s++){var u=(0,e[s])(t,n,r,o,a,ye);if(null==u)return null;u.data&&Ee(u.data,"expectedType")&&l.push(u.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+r+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,o,a){var l=t[n],u=c(l);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var p in e){var f=e[p];if("function"!=typeof f)return s(r,o,a,p,d(f));var m=f(l,p,r,o,a+"."+p,ye);if(m)return m}return null})},exact:function(e){return a(function(t,n,r,o,a){var l=t[n],u=c(l);if("object"!==u)return new i("Invalid "+o+" `"+a+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var p=ge({},t[n],e);for(var f in p){var m=e[f];if(Ee(e,f)&&"function"!=typeof m)return s(r,o,a,f,d(m));if(!m)return new i("Invalid "+o+" `"+a+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=m(l,f,r,o,a+"."+f,ye);if(v)return v}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,o,a,l,s){if(o=o||"<<anonymous>>",l=l||r,s!==ye){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}return null==n[r]?t?new i(null===n[r]?"The "+a+" `"+l+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+a+" `"+l+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,r,o,a,l)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function l(e){return a(function(t,n,r,o,a,l){var s=t[n];return c(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+d(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,r,o){return new i((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function u(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(u);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!u(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!u(a[1]))return!1}return!0;default:return!1}}function c(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=c(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function p(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return i.prototype=Error.prototype,r.checkPropTypes=Ce,r.resetWarningCache=Ce.resetWarningCache,r.PropTypes=r,r}(pe.isElement):function(){function e(e,t,n,r,o,i){if(i!==ye){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:we,resetWarningCache:Ne};return n.PropTypes=n,n}()});const Le=["onClick","style","children","className","ReactRef"],ke=e=>{var t;let{onClick:n,style:o,children:a,className:l,ReactRef:s}=e,u=d(e,Le);const{pathname:p}=i.useLocation(),f=Digit.Hooks.fsm.useRouteSubscription(p),m=null===(t=Digit.UserService.getUser())||void 0===t?void 0:t.info;return r.createElement("div",c({className:("employee"===f||"EMPLOYEE"===(null==m?void 0:m.type)?"employeeCard":"card")+" "+(l||""),onClick:n,style:o},u,{ref:s}),a)},Oe=e=>r.createElement("div",{className:"card-header",style:e.styles?c({},e.styles,{marginBottom:"30px"}):{marginBottom:"30px"}},e.children,e.divider&&r.createElement("hr",{style:{border:"1px solid #DFE0E2",marginTop:"10px"}}));Oe.propTypes={styles:Ie.object,divider:Ie.bool,children:Ie.node.isRequired},Oe.defaultProps={styles:{},divider:!1};const Re=e=>r.createElement("p",{className:"card-text "+(e.disable&&"disabled")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),Pe=e=>r.createElement("h2",{className:"card-label-error "+(null!=e&&e.className?null==e?void 0:e.className:""),style:e.style},e.children),Me=e=>{let{header:t,cardText:o,nextText:i,t:a,forcedError:l,onSave:s,onChange:u,position:c,onSelect:d,disabled:p,cardBodyStyle:f={},isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:h,handleRemove:g,Webview:y=!1,isPopUp:E=!1}=e;const S=n.useRef(!0);n.useEffect(()=>()=>{S.current=!1},[]);const[b,_]=n.useState(Boolean(p||!1));n.useEffect(()=>{S.current&&_(Boolean(p||!1))},[p]);const[A,D]=n.useState({latitude:0,longitude:0}),[C,T]=n.useState(),[x,N]=n.useState(),w=e=>{S.current&&T(e)},I=e=>{S.current&&D(e)};return r.createElement(ke,{style:{position:"relative"}},r.createElement("div",{style:{display:"flex"}},r.createElement("svg",{style:{marginTop:y?"16px":"8px"},width:"24",height:"24",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M14.9999 9.66666C12.0533 9.66666 9.66658 12.0533 9.66658 15C9.66658 17.9467 12.0533 20.3333 14.9999 20.3333C17.9466 20.3333 20.3333 17.9467 20.3333 15C20.3333 12.0533 17.9466 9.66666 14.9999 9.66666ZM26.9199 13.6667C26.3066 8.10666 21.8933 3.69333 16.3333 3.07999V0.333328H13.6666V3.07999C8.10658 3.69333 3.69325 8.10666 3.07992 13.6667H0.333252V16.3333H3.07992C3.69325 21.8933 8.10658 26.3067 13.6666 26.92V29.6667H16.3333V26.92C21.8933 26.3067 26.3066 21.8933 26.9199 16.3333H29.6666V13.6667H26.9199ZM14.9999 24.3333C9.83992 24.3333 5.66658 20.16 5.66658 15C5.66658 9.83999 9.83992 5.66666 14.9999 5.66666C20.1599 5.66666 24.3333 9.83999 24.3333 15C24.3333 20.16 20.1599 24.3333 14.9999 24.3333Z",fill:"#505A5F"})),r.createElement(Oe,null,t)),r.createElement("div",{style:f},E&&r.createElement("button",{type:"button",onClick:()=>g&&g(),style:{position:"absolute",left:12,top:12,padding:"8px 10px",background:"#fff",color:"#0b74de",border:"none",borderRadius:6,cursor:"pointer",fontWeight:700,fontSize:13,lineHeight:"16px",zIndex:9999,appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"},"aria-label":"Close",title:"Close"},r.createElement("span",{style:{color:"red",display:"inline-block"}},"Close")),r.createElement(Re,null,o),r.createElement(z,{onChange:h?(e,t,n)=>{w(e),I(t),(e=>{S.current&&N(e)})(n),S.current&&_(!e)}:(e,t)=>{w(e),I(t),S.current&&_(!e)},position:c,isPTDefault:m,PTdefaultcoord:v,isPlaceRequired:h}),l&&r.createElement(Pe,null,a(l))),r.createElement("div",{style:{padding:"12px"}},(()=>{const e=null!=i?i:a?a("ADS_PIN_LOCATION_LABEL"):null,t="string"==typeof e&&e.trim()?e:a&&a("ADS_PIN_LOCATION_LABEL")||"Pick";return r.createElement("button",{type:"button",onClick:e=>{e&&e.preventDefault(),e&&e.stopPropagation(),(()=>{const e={geoLocation:A};if("function"!=typeof d)if("function"!=typeof s)"function"!=typeof u?console.warn("LocationSearchCard: no submit callback provided by parent."):x&&Object.keys(x).length?u(C,A,x):u(C,A);else try{s(A,C,x)}catch(t){try{s(e)}catch(e){console.warn("LocationSearchCard: onSave call failed",e)}}else d("address",e)})()},disabled:b,"aria-disabled":b,style:{display:"inline-block",width:"100%",padding:"10px 12px",background:b?"#ddd":"#0b74de",color:b?"#666":"#fff",border:"none",borderRadius:6,cursor:b?"not-allowed":"pointer",textAlign:"center",fontWeight:700,fontSize:14,lineHeight:"20px",WebkitTextFillColor:b?"#666":"#fff",appearance:"none",WebkitAppearance:"none",backgroundImage:"none",textTransform:"none"}},t||"Pick"," ")})()))};Me.propTypes={header:Ie.string,cardText:Ie.string,nextText:Ie.string,t:Ie.func,skipAndContinueText:Ie.string,skip:Ie.func,onSave:Ie.func,onChange:Ie.func,position:Ie.any,onSelect:Ie.func,isPTDefault:Ie.any,PTdefaultcoord:Ie.any,isPlaceRequired:Ie.any,handleRemove:Ie.func,Webview:Ie.bool,isPopUp:Ie.bool},Me.defaultProps={header:"",cardText:"",nextText:"",skipAndContinueText:"",onSelect:null,skip:()=>{},onSave:null,onChange:()=>{},position:void 0,isPTDefault:!1,PTdefaultcoord:{},isPlaceRequired:!1,handleRemove:()=>{},Webview:!1,isPopUp:!1};const Be=e=>{let{t:n,currentPage:o,columns:i,data:a,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,isPaginationRequired:f,pageSizeLimit:m,sortParams:v,totalRecords:h}=e;return r.createElement(t.Table,{t:n,data:a,currentPage:o,columns:i,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:m,disableSort:s,isPaginationRequired:f,onPageSizeChange:p,onSort:u,sortParams:v,totalRecords:h})},Fe=e=>{let{onSubmit:i,setExistingDataSet:a,Searchdata:l}=e;const{t:s}=o.useTranslation(),u=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[d,p]=n.useState(null),[f,m]=n.useState(!1),v=Digit.UserService.getUser().info,h=Digit.Hooks.ads.useADSSlotSearch(),g={advertisementSlotSearchCriteria:l.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:u,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};n.useEffect(()=>{f&&(i(),m(!1))},[f,i]);let y,E=window.location.href.split("/").pop();isNaN(parseInt(E))||(y=E);let S=isNaN(parseInt(E))?{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:u,mobileNumber:null==v?void 0:v.mobileNumber}:{limit:"3",sortOrder:"ASC",sortBy:"createdTime",offset:y,tenantId:u};n.useEffect(()=>{p(S)},[E]);const{isLoading:b,data:_}=Digit.Hooks.ads.useADSSearch({filters:d});if(b)return r.createElement(t.Loader,null);const A=(null==_?void 0:_.bookingApplication)||[],D={padding:"10px",margin:"10px 0",border:"1px solid #ccc",transition:"background-color 0.3s ease, box-shadow 0.3s ease"},C={boxShadow:"1px 4px 4px 7px rgba(0, 0, 0, 0.5)"};return r.createElement(r.Fragment,null,r.createElement("div",null,A.length>0&&A.map((e,n)=>{var o;return r.createElement("div",{key:n},r.createElement(t.Card,{style:c({},D,{cursor:"pointer"}),onMouseEnter:e=>{e.currentTarget.style.backgroundColor=C.backgroundColor,e.currentTarget.style.boxShadow=C.boxShadow},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.boxShadow=""},onClick:()=>{!function(e){try{Promise.resolve(h.mutateAsync(g)).then(function(t){var n,r,o,i,l,s,u,c,d,p,f;const v=null==t?void 0:t.advertisementSlotAvailabiltityDetails[0].timerValue,h={documents:{documents:null==e||null===(n=e.documents)||void 0===n?void 0:n.map(e=>({documentDetailId:null==e?void 0:e.documentDetailId,documentType:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.fileStoreId}))},address:{pincode:null==e||null===(r=e.address)||void 0===r?void 0:r.pincode,houseNo:null==e||null===(o=e.address)||void 0===o?void 0:o.houseNo,streetName:null==e||null===(i=e.address)||void 0===i?void 0:i.streetName,landmark:null==e||null===(l=e.address)||void 0===l?void 0:l.landmark,addressline1:null==e||null===(s=e.address)||void 0===s?void 0:s.addressLine1,addressline2:null==e||null===(u=e.address)||void 0===u?void 0:u.addressLine2},applicant:{applicantName:null==e||null===(c=e.applicantDetail)||void 0===c?void 0:c.applicantName,mobileNumber:null==e||null===(d=e.applicantDetail)||void 0===d?void 0:d.applicantMobileNo,alternateNumber:null==e||null===(p=e.applicantDetail)||void 0===p?void 0:p.applicantAlternateMobileNo,emailId:null==e||null===(f=e.applicantDetail)||void 0===f?void 0:f.applicantEmailId},timervalue:{timervalue:v||0},draftId:(null==t?void 0:t.draftId)||""};a(h),m(!0)})}catch(e){return Promise.reject(e)}}(e)}},r.createElement(t.KeyNote,{keyValue:s("ADS_BOOKING_NO"),note:null==e?void 0:e.bookingNo}),r.createElement(t.KeyNote,{keyValue:s("ADS_APPLICANT_NAME"),note:null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantName}),r.createElement(t.KeyNote,{keyValue:s("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:s(""+(null==e?void 0:e.bookingStatus))})))}),0===A.length&&!b&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},s("ADS_NO_APPLICATION_FOUND_MSG"))))},je=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),He=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(je,null)),Ue=e=>{let{t:o,closeModal:i,onSubmit:a,setExistingDataSet:l,Searchdata:s}=e;const[u,c]=n.useState(!1),[d,p]=n.useState(!1),f=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),m=e=>u&&r.createElement("h1",{className:"heading-m"},e.t("ADS_MY_BOOKINGS_HEADER")),v=Digit.Hooks.ads.useADSSlotSearch(),h={advertisementSlotSearchCriteria:s.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:f,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,isTimerRequired:!0}))};return n.useEffect(()=>{d&&(a(),p(!1))},[d,a]),r.createElement(r.Fragment,null,r.createElement(t.Modal,{headerBarMain:r.createElement(m,{t:o}),headerBarEnd:r.createElement(He,{onClick:i}),actionCancelLabel:u&&o("CS_COMMON_BACK"),actionCancelOnSubmit:()=>c(!1),hideSubmit:!0,formId:"modal-action"},r.createElement(t.Card,{style:{boxShadow:"none"}},u&&r.createElement(Fe,{onSubmit:a,setExistingDataSet:l,Searchdata:s}),r.createElement("div",{style:{display:"flex",justifyContent:"center",gap:"20px",flexDirection:"column",alignItems:"center"}},!u&&r.createElement(t.SubmitBar,{label:o("USE_EXISTING_DETAILS"),onSubmit:()=>{c(!0)}}),!u&&r.createElement(t.SubmitBar,{label:o("FILL_NEW_DETAILS"),onSubmit:function(){try{return Promise.resolve(v.mutateAsync(h)).then(function(e){l({timervalue:{timervalue:(null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue)||10},draftId:(null==e?void 0:e.draftId)||""}),p(!0)})}catch(e){return Promise.reject(e)}}})))))},ze=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),We=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(ze,null)),qe=e=>{let{onClose:n,cartDetails:a,setCartDetails:l}=e;const{t:s}=o.useTranslation(),u=(i.useLocation(),[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},s("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:s("ADD_TYPE"),accessor:"addType"},{Header:s("FACE_AREA"),accessor:"faceArea"},{Header:s("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,s(t?"Yes":"No"))}},{Header:s("BOOKING_DATE"),accessor:"bookingDate"},{Header:s("UNIT_PRICE"),accessor:"price"},{Header:s("ADS_STATUS"),accessor:"status",Cell:e=>{let{value:t}=e;return r.createElement("div",{className:"sla-cell-success"},t)}},{Header:s("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{const t=a.filter((t,n)=>n!==e);l(t)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}]);return r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(We,{onClick:n}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Be,{t:s,data:a,columns:u,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:a.length}),r.createElement("div",{style:{position:"sticky",bottom:0,backgroundColor:"#fff",padding:"15px 20px",fontSize:"18px",fontWeight:"bold",boxShadow:"0 -2px 5px rgba(0,0,0,0.1)",zIndex:10}},"Total Price: ",a.reduce((e,t)=>e+Number(t.price),0)))},Ve=e=>{let{styles:t,className:n}=e;return r.createElement("svg",{width:"24",height:"24",className:n,style:c({},t),viewBox:"0 0 24 24",fill:"#ffffff",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M7 10H4V17H7V10Z"}),r.createElement("path",{d:"M13.5 10H10.5V17H13.5V10Z"}),r.createElement("path",{d:"M22 19H2V22H22V19Z"}),r.createElement("path",{d:"M20 10H17V17H20V10Z"}),r.createElement("path",{d:"M12 1L2 6V8H22V6L12 1Z"}))},Ge=e=>{let{headComment:t,otherComment:n}=e;return r.createElement("div",{className:"checkpoint-comments-wrap"},r.createElement("h4",null,t),r.createElement("p",null,n))},Ke=e=>{var n,i,a;let{data:l,OpenImage:s}=e;const{t:u}=o.useTranslation();return r.createElement("div",null,l.date&&r.createElement("p",null,l.date),r.createElement("p",null,l.name),l.mobileNumber&&r.createElement(t.TelePhone,{mobile:l.mobileNumber}),l.source&&r.createElement("p",null,u("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+l.source.toUpperCase())),l.comment&&r.createElement(Ge,{otherComment:null==l?void 0:l.otherComment,headComment:null==l?void 0:l.comment}),null!=l&&l.wfComment?r.createElement("div",null,null==l||null===(n=l.wfComment)||void 0===n?void 0:n.map(e=>r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("WF_COMMON_COMMENTS")),r.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==l||null===(i=l.thumbnailsToShow)||void 0===i||null===(a=i.thumbs)||void 0===a?void 0:a.length)>0?r.createElement("div",{className:"TLComments"},r.createElement("h3",null,u("CS_COMMON_ATTACHMENTS")),r.createElement(t.DisplayPhotos,{srcs:null==l?void 0:l.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==l?void 0:l.thumbnailsToShow)}})):null)};"undefined"!=typeof window&&void 0===window.process&&(window.process={env:{}});const Ye=e=>{var o,i;let{t:a,onSelect:l,formData:s={},handleRemove:u,onSave:c}=e;const[d,p]=n.useState((null==s||null===(o=s.address)||void 0===o?void 0:o.pincode)||""),[f,m]=n.useState((null==s||null===(i=s.address)||void 0===i?void 0:i.geoLocation)||{}),v=Digit.Hooks.obps.useTenants(),[h,g]=n.useState(null),[y,E]=n.useState("");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let S=!Digit.Utils.browser.isMobile();return r.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0",zIndex:9999},onClick:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onMouseDown:e=>{e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation()},onKeyDown:e=>{!e||"Enter"!==e.key&&" "!==e.key&&"Spacebar"!==e.key||(e&&e.preventDefault&&e.preventDefault(),e&&e.stopPropagation&&e.stopPropagation())}},r.createElement("div",{style:{position:"relative",marginTop:"60px"}},r.createElement("div",{style:S?{marginLeft:"25%",marginRight:"25%"}:{}},r.createElement(t.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:a?a("ADS_GIS_LABEL"):"Pick location",nextText:a&&a("ADS_PIN_LOCATION_LABEL")||"Pick location",skip:()=>{if("function"==typeof l)try{return l()}catch(e){return void console.warn("GIS: onSelect threw",e)}if("function"==typeof c)try{return c(f||{},d||"",y||"")}catch(e){try{return c({geoLocation:f||{},pincode:d||"",placeName:y||""})}catch(e){console.warn("GIS: onSave also failed",e)}}console.warn("GIS: neither onSelect nor onSave provided for skip")},t:a,position:f,onSave:()=>{if("function"==typeof c)try{c(f,d,y)}catch(e){try{c({geoLocation:f,pincode:d,placeName:y})}catch(e){console.warn("GIS: onSave call failed",e)}}else console.warn("GIS: onSave not provided")},onChange:(e,t,n)=>{((e,t,n)=>{g(null),(null==v?void 0:v.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==e)}))?(p(e),m(t),E(n)):(g("BPA_COMMON_PINCODE_NOT_SERVICABLE"),p(""),m({}),E(""))})(e,t,n)},disabled:!1,forcedError:h?a(h):null,isPlaceRequired:!0,handleRemove:u,Webview:S,isPopUp:!0}))))},$e=e=>{var n,i,a,l,s,u,c,d;const{t:p}=o.useTranslation(),f=null==e||null===(n=e.application)||void 0===n||null===(i=n.workflow)||void 0===i?void 0:i.businessService,{isLoading:m,data:v}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id||(null===(l=e.application)||void 0===l?void 0:l.applicationNumber)||(null===(s=e.application)||void 0===s?void 0:s.bookingNo),moduleCode:"advandhoarding-services"});function h(e,t,n){var r;window.open(null==n||null===(r=n.fullImage)||void 0===r?void 0:r[0],"_blank")}const g=t=>{if("OPEN"===t.state){var n,o;const i={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(o=e.application)||void 0===o?void 0:o.channel)||""};return r.createElement(Ke,{data:i})}if(t.state){var i,a,l,s,u;const e={date:null==t||null===(i=t.auditDetails)||void 0===i?void 0:i.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(l=a[0])||void 0===l?void 0:l.name,mobileNumber:null==t||null===(s=t.assignes)||void 0===s||null===(u=s[0])||void 0===u?void 0:u.mobileNumber,comment:p(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return r.createElement(Ke,{data:e,OpenImage:h})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:p(null==t?void 0:t.comment)};return r.createElement(Ke,{data:n})}};return m?r.createElement(t.Loader,null):r.createElement(r.Fragment,null,(null==v||null===(u=v.timeline)||void 0===u?void 0:u.length)>0&&r.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=v&&v.timeline&&1===(null==v||null===(c=v.timeline)||void 0===c?void 0:c.length)?r.createElement(t.CheckPoint,{isCompleted:!0,label:p((null==v||null===(d=v.timeline[0])||void 0===d?void 0:d.state)&&"WF_"+f+"_"+v.timeline[0].state||"NA"),customChild:g(null==v?void 0:v.timeline[0])}):r.createElement(t.ConnectingCheckPoints,null,(null==v?void 0:v.timeline)&&(null==v?void 0:v.timeline.map((e,n)=>{var o;let i="";if(window.location.href.includes("/obps/")){var a,l;const t=null==v||null===(a=v.timeline)||void 0===a||null===(l=a[n-1])||void 0===l?void 0:l.state;i=t&&(t.includes("BACK_FROM")||t.includes("SEND_TO_CITIZEN"))?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0===n?"":"_DONE"}return r.createElement(r.Fragment,{key:n},r.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:p("ES_ADS_COMMON_STATUS_"+(null==v||null===(o=v.processInstances[n].state)||void 0===o?void 0:o.state)+i),customChild:g(e)}))}))))};let Xe=[];const Ze=e=>{let{currentStep:n=1,flow:i=""}=e;const{t:a}=o.useTranslation(),l=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":Xe=[];break;default:Xe=["ADS_APPLICANT_DETAILS","ADS_ADDRESS_DETAILS","ADS_UPLOAD_DOCUMENTS","ADS_SUMMARY"]}})(i),r.createElement("div",{className:"timeline-container",style:l?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},Xe.map((e,o,i)=>r.createElement("div",{className:"timeline-checkpoint",key:o},r.createElement("div",{className:"timeline-content"},r.createElement("span",{className:"circle "+(o<=n-1&&"active")},o<n-1?r.createElement(t.TickMark,null):o+1),r.createElement("span",{className:"secondary-color"},a(e))),o<i.length-1&&r.createElement("span",{className:"line "+(o<n-1&&"active")}))))},Je=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Qe=e=>{let{onClick:t}=e;return r.createElement("div",{className:"icon-bg-secondary",onClick:t},r.createElement(Je,null))},et=()=>{var e,i,a,l,s,u,d,p,f,m,v,h,g,y,E;const[S,b]=n.useState(!1),[_,A]=n.useState(!1),{t:D}=o.useTranslation(),[C,T]=Digit.Hooks.useSessionStorage("ADS_CREATE",{}),x=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[N,w]=n.useState(!1),[I,L]=n.useState(!1),k=[{Header:()=>r.createElement("div",{style:{paddingLeft:"50px"}},D("S_NO")),accessor:"sNo",Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},t.index+1," ")}},{Header:D("ADD_TYPE"),accessor:"addType"},{Header:D("FACE_AREA"),accessor:"faceArea"},{Header:D("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,D(t?"Yes":"No"))}},{Header:D("BOOKING_DATE"),accessor:"bookingDate"},{Header:D("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>(e=>{var t;const n=c({},C);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),T(n)})(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}];let O={tenantId:x,cartDetails:null==C||null===(e=C.adslist)||void 0===e?void 0:e.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}))},R=Digit.Hooks.ads.useADSDemandEstimation();!1===N&&(R.mutate(O),w(!0));const P=()=>{A(e=>!e)},M=()=>{L(!I)},B=()=>{b(e=>!e)},F=(null===(i=R.data)||void 0===i?void 0:i.demands[0])&&(null===(a=R.data)||void 0===a||null===(l=a.demands[0])||void 0===l?void 0:l.additionalDetails);return r.createElement("div",null,r.createElement(t.CardSubHeader,{style:{color:"#a82227"}},"Cart Details"),r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement("div",null,r.createElement("div",{onClick:P,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},r.createElement("div",{class:"container",style:{width:"1px"}}," ",r.createElement("div",{style:{width:"20px",position:"relative"}},r.createElement("div",{style:{position:"absolute",top:"-4px",right:"-93px",color:"#008000",padding:"5px",borderRadius:"30px",width:"30px",height:"30px",textAlign:"center"}},r.createElement("div",null," ",null==C||null===(s=C.adslist)||void 0===s?void 0:s.cartDetails.length)))),"View Cart"),r.createElement("div",{onClick:B,style:{cursor:"pointer",color:"#a82227",fontSize:"20px",textDecoration:"none",marginBottom:"10px"}},"Terms and Conditions")),r.createElement("div",{onClick:M,style:{cursor:"pointer",fontSize:"20px",color:"#a82227"}},"Total Booking Amount: ",r.createElement("strong",null,F," INR"))),S&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Terms and Conditions"),headerBarEnd:r.createElement(Qe,{onClick:B}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"80%",overflowY:"auto"},actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},popupModuleMianStyles:{padding:"10px"},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:S,onClose:B}),_&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"My Cart"),headerBarEnd:r.createElement(Qe,{onClick:P}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"80vh",width:"80%",overflowY:"auto"},popupModuleMianStyles:{padding:"10px"},hideSubmit:!0,headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},formId:"modal-action"},r.createElement(Be,{t:D,data:null==C||null===(u=C.adslist)||void 0===u?void 0:u.cartDetails,columns:k,getCellProps:e=>({style:{minWidth:"150px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:null==C||null===(d=C.adslist)||void 0===d?void 0:d.cartDetails.length})),I&&r.createElement(t.Modal,{headerBarMain:r.createElement(t.CardSubHeader,{style:{color:"#a82227",margin:"25px"}},"Price Breakup"),headerBarEnd:r.createElement(Qe,{onClick:M}),popupStyles:{backgroundColor:"#fff",position:"relative",maxHeight:"90vh",width:"60%",overflowY:"auto"},children:r.createElement("div",null,r.createElement(t.CardLabelDesc,{style:{marginBottom:"15px"}},"Estimate Price Details"),r.createElement("ul",null,(null===(p=R.data)||void 0===p||null===(f=p.demands[0])||void 0===f?void 0:f.demandDetails)&&(null===(m=R.data)||void 0===m||null===(v=m.demands[0])||void 0===v?void 0:v.demandDetails.map((e,n)=>r.createElement("li",{key:n,style:{display:"flex",justifyContent:"space-between"}},r.createElement(t.CardText,null,D(""+e.taxHeadMasterCode)),r.createElement(t.CardText,null,"Rs ",e.taxAmount))))),r.createElement("hr",null),r.createElement("div",{style:{fontWeight:"bold",marginTop:"10px",display:"flex",justifyContent:"space-between"}},r.createElement(t.CardLabelDesc,null,"Total"),r.createElement(t.CardLabelDesc,null,"Rs ",(null===(h=R.data)||void 0===h||null===(g=h.demands[0])||void 0===g?void 0:g.demandDetails)&&(j=null===(y=R.data)||void 0===y||null===(E=y.demands[0])||void 0===E?void 0:E.demandDetails,j.reduce((e,t)=>e+t.taxAmount,0))))),actionCancelLabel:null,actionCancelOnSubmit:null,actionSaveLabel:null,actionSaveOnSubmit:null,actionSingleLabel:null,actionSingleSubmit:null,error:null,setError:()=>{},formId:"modalForm",isDisabled:!1,hideSubmit:!0,style:{},headerBarMainStyle:{position:"sticky",top:0,backgroundColor:"#f5f5f5"},isOBPSFlow:!1,popupModuleActionBarStyles:{display:"none"},isOpen:I,onClose:M}));var j};function tt(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const nt=e=>{let{t:o,SlotSearchData:i,draftId:a=""}=e;const[l,s]=n.useState(0),[u,c]=n.useState(null),d=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[p,f]=n.useState(!1),m=Digit.Hooks.ads.useADSSlotSearch(),v={advertisementSlotSearchCriteria:i.map(e=>({bookingId:"",addType:null==e?void 0:e.addTypeCode,bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==e?void 0:e.bookingDate,faceArea:null==e?void 0:e.faceAreaCode,tenantId:d,location:null==e?void 0:e.location,nightLight:null==e?void 0:e.nightLight,draftId:a,isTimerRequired:!0}))};return n.useEffect(()=>{0!==l||p||(function(){try{const e=tt(function(){return Promise.resolve(m.mutateAsync(v)).then(function(e){var t;const n=null==e||null===(t=e.advertisementSlotAvailabiltityDetails)||void 0===t?void 0:t.some(e=>"BOOKED"===e.slotStaus),r=null==e?void 0:e.advertisementSlotAvailabiltityDetails[0].timerValue;n?c({error:!0,label:o("ADS_ADVERTISEMENT_ALREADY_BOOKED")}):s(r||0)})},function(){c({error:!0,label:o("CS_SOMETHING_WENT_WRONG")})});Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),f(!0))},[o,l,p]),n.useEffect(()=>{if(l>0){const e=setInterval(()=>{s(t=>t<=0?(clearInterval(e),0):t-1)},1e3);return()=>clearInterval(e)}},[l]),n.useEffect(()=>{if(u){const e=setTimeout(()=>{c(null)},2e3);return()=>clearTimeout(e)}},[u]),r.createElement("div",null,r.createElement("span",{className:"astericColor"},(e=>{const t=e%60;return Math.floor(e/60)+":"+(t<10?"0":"")+t})(l)),u&&r.createElement(t.Toast,{error:u.error,warning:u.warning,label:o(u.label),onClose:()=>{c(null)}}))};function rt(e){var o;let{t:i,document:a,setDocuments:l,setError:s,documents:u,action:d,formData:p,id:f}=e;const m=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],v=Digit.UserService.getUser().info,[h,g]=(Digit.ULBService.getCurrentTenantId(),n.useState(m?c({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:"ADS_"+(null==m?void 0:m.documentType.replaceAll(".","_"))}):(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)>0?null==a?void 0:a.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[_,A]=n.useState(!1),{dropdownData:D}=a;var C=D;const[T,x]=n.useState(!1),N=()=>r.createElement("div",{className:"loading-spinner"});return n.useEffect(()=>{null!=h&&h.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==S?void 0:S.length)||null===S?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==h?void 0:h.code,fileStoreId:S,documentUid:S}]})},[S,h]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],r=C.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(g(r),b(null==n?void 0:n.fileStoreId)):x(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=tt(function(){return b(null),A(!0),Promise.resolve(Digit.UploadServices.Filestorage("ADS",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){s(i("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(A(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{T&&b(null)},[T]),r.createElement("div",{style:{marginBottom:"24px"}},null!=a&&a.hasDropdown?r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i("ADS_"+(null==a?void 0:a.code.replaceAll(".","_")))," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.Dropdown,{className:"form-field",selected:h,style:{width:"EMPLOYEE"===v.type?"50%":"100%"},placeholder:"Select "+i("ADS_"+(null==a?void 0:a.code.replaceAll(".","_"))),option:C.map(e=>{var t;return c({},e,{i18nKey:"ADS_"+(null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_"))})}),select:e=>g(e),optionKey:"i18nKey",t:i})):null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){E(e.target.files[0])},onDelete:()=>{b(null)},id:f,message:_?r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(N,null),r.createElement("span",null,"Uploading...")):S?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function ot(e){let{value:n={},Code:i,index:a,showFileName:l=!1}=e;o.useTranslation();const{isLoading:s,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:n},{value:n},i,a),d=e=>{let{width:t=20,height:n=20,style:o}=e;return r.createElement("svg",{style:o,xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 20 20",fill:"gray"},r.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))},p=null!=n&&n.documents?n.documents.documents.filter(e=>e.documentType===i).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")})):n.filter(e=>e.documentType===i).map(e=>c({},e,{documentType:e.documentType.replace(/\./g,"_")}));return s?r.createElement(t.Loader,null):r.createElement("div",null,r.createElement(r.Fragment,null,r.createElement("div",null,p.map((e,t)=>{let n=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t="");let r=e[t]||"",o=(null==r?void 0:r.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i}(u.pdfFiles,e.fileStoreId);return r.createElement("a",{target:"_",href:n,style:{minWidth:"160px"},key:t},r.createElement(d,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}))}))))}const it=e=>{let{jumpTo:n}=e;const{t:a}=o.useTranslation(),l=i.useHistory();return r.createElement(t.LinkButton,{label:a("CS_COMMON_EDIT"),className:"check-page-link-button",onClick:function(){l.push(n)}})},at=()=>{const{t:e}=o.useTranslation(),{data:i,isFetching:a,isSuccess:l}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"ADS",filters:{limit:10,offset:0,services:["ads"]},config:{select:e=>({tSotalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.ptAccess()}});n.useEffect(()=>{!a&&l&&u(i)},[a]);const[s,u]=n.useState("-");if(!Digit.Utils.adsAccess())return null;const c=[{label:e("ADS_BOOK"),link:"/digit-ui/employee/ads/bookad/searchads"},{label:e("ADS_SEARCH_BOOKINGS"),link:"/digit-ui/employee/ads/my-applications"}],d=Digit.UserService.hasAccess(["ADS_CEMP"])||!1,p={Icon:r.createElement(Ve,null),moduleName:e("ADS_ADVERTISEMENT_MODULE"),links:c.filter(e=>!(null!=e&&e.role)||d)};return r.createElement(t.EmployeeModuleCard,p)},lt=e=>{var o,i;let{value:a,onChange:l,onBlur:s,t:u}=e;const[c,d]=n.useState(!1),[p,f]=n.useState(""),m="undefined"!=typeof window&&(null===(o=window.location)||void 0===o||null===(i=o.href)||void 0===i?void 0:i.includes("citizen"));return n.useEffect(()=>{f(a?"string"==typeof a?a:a.formattedAddress||(a.latitude&&a.longitude?a.latitude+", "+a.longitude:""):"")},[a]),r.createElement(n.Fragment,null,r.createElement("div",{style:{width:"100%",marginTop:"8px"}},r.createElement(t.TextInput,{value:p,onChange:()=>{},onBlur:s,disabled:!0,placeholder:u("ADS_LOCATION"),style:{maxWidth:!m&&"330px"}})),c&&r.createElement(Ye,{t:u,formData:{address:{pincode:(null==a?void 0:a.pincode)||"",geoLocation:a||{}}},handleRemove:()=>d(!1),onSave:(e,t,n)=>((e,t,n)=>{const r=((e,t,n)=>{var r,o,i,a,l,s;return{formattedAddress:n||(null==e?void 0:e.formattedAddress)||(null==e?void 0:e.place_name)||"",latitude:null!=(r=null!=(o=null!=(i=null==e?void 0:e.latitude)?i:null==e?void 0:e.lat)?o:null==e?void 0:e.y)?r:null,longitude:null!=(a=null!=(l=null!=(s=null==e?void 0:e.longitude)?s:null==e?void 0:e.lng)?l:null==e?void 0:e.x)?a:null,placeId:(null==e?void 0:e.placeId)||(null==e?void 0:e.id)||null,raw:e||{},pincode:t||null}})(e,t,n);f(r.formattedAddress),l&&l(r),d(!1)})(e,t,n)}))},st=e=>{let{t:n,currentPage:o,columns:i,data:a,getCellProps:l,disableSort:s,onSort:u,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:f,sortParams:m,totalRecords:v}=e;return r.createElement(t.Table,{t:n,data:a,currentPage:o,columns:i,getCellProps:l,onNextPage:c,onPrevPage:d,pageSizeLimit:f,disableSort:s,onPageSizeChange:p,onSort:u,sortParams:m,totalRecords:v})},ut=e=>{const{t:a}=o.useTranslation(),l=[{text:a("ES_TITLE_NEW_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad",roles:[]}],[s,u]=n.useState([]);return Digit.UserService.getUser(),n.useEffect(()=>{u(l)},[]),r.createElement(t.Card,{className:"employeeCard filter inboxLinks"},r.createElement("div",{className:"complaint-links-container"},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.PropertyHouse,null))," ",r.createElement("span",{className:"text"},a("ADS_SERVICE"))),r.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:o,hyperlink:l=!1,roles:s=[]}=e;return r.createElement("span",{className:"link",key:t},l?r.createElement("a",{href:n},o):r.createElement(i.Link,{to:n},a(o)))}))))},ct=["pattern","name","maxLength","minLength","errorMessages"],dt={date:t.DatePicker,mobileNumber:t.MobileNumber,Locality:e=>r.createElement(t.Localities,{tenantId:Digit.ULBService.getCurrentTenantId(),selectLocality:e.onChange,keepNull:!1,boundaryType:"revenue",selected:e.value,disableLoader:!0,sortFn:(e,t)=>e.i18nkey<t.i18nkey?-1:1})},pt=e=>{var i;let{onSearch:l,type:s,onClose:u,searchFields:p,searchParams:f,isInboxPage:m,clearSearch:v}=e;const{t:h}=o.useTranslation(),{handleSubmit:g,reset:y,watch:E,control:S,setError:b,clearErrors:_,formState:A,setValue:D}=a.useForm({defaultValues:m?f:c({locality:null,city:null},f)}),C=E(),T=innerWidth<=640;function x(){const e=p.reduce((e,t)=>c({},e,{[null==t?void 0:t.name]:""}),{});if(y(e),m){const e=c({},f);e.delete=[],p.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),l(c({},e))}else v()}n.useEffect(()=>{p.forEach(e=>{let{pattern:t,name:n,maxLength:r,minLength:o,errorMessages:i}=e;d(e,ct);const a=C[n],l=A.errors[n];t&&(new RegExp(t).test(a)||l?new RegExp(t).test(a)&&"pattern"===(null==l?void 0:l.type)&&_([n]):b(n,{type:"pattern",message:h(null==i?void 0:i.pattern)||h("PATTERN_"+n.toUpperCase()+"_FAILED")})),o&&((null==a?void 0:a.length)<o&&!l?b(n,{type:"minLength",message:h((null==i?void 0:i.minLength)||"MINLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==a?void 0:a.length)>=o&&"minLength"===(null==l?void 0:l.type)&&_([n])),r&&((null==a?void 0:a.length)>r&&!l?b(n,{type:"maxLength",message:h((null==i?void 0:i.maxLength)||"MAXLENGTH_"+n.toUpperCase()+"_FAILED")}):(null==a?void 0:a.length)<=r&&"maxLength"===(null==l?void 0:l.type)&&_([n]))})},[C,A,b,_]);const N=e=>r.createElement(t.LinkLabel,{style:c({display:"inline"},e?{margin:0}:{}),onClick:x},h("ES_COMMON_CLEAR_SEARCH"));return r.createElement("form",{onSubmit:g(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],p.forEach(t=>{e[t.name]||e.delete.push(t.name)}),l(e),"mobile"===s&&u()})},r.createElement(r.Fragment,null,r.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:m?"24px":"revert"}},r.createElement("div",{className:"search-complaint-container"},("mobile"===s||T)&&r.createElement("div",{className:"complaint-header"},r.createElement("h2",null,h("ES_COMMON_SEARCH_BY")),r.createElement("span",{onClick:u},r.createElement(t.CloseSvg,null))),r.createElement("div",{className:"complaint-input-container for-pt "+(m?"":"for-search"),style:{width:"100%",display:"grid"}},null==p||null===(i=p.filter(e=>!0))||void 0===i?void 0:i.map((e,n)=>{var o,i,l;return r.createElement("div",{key:e.name,className:"input-fields"},r.createElement("span",{className:"mobile-input"},r.createElement(t.Label,null,h(e.label)+" "+(e.isMendatory?"*":"")),r.createElement(a.Controller,e.type?{render:t=>r.createElement(null==dt?void 0:dt[e.type],{formValue:C,setValue:D,onChange:t.onChange,value:t.value}),name:e.name,control:S,defaultValue:""}:{render:e=>r.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:S,defaultValue:""})),null!=A&&null!==(o=A.dirtyFields)&&void 0!==o&&o[e.name]?r.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==A||null===(i=A.errors)||void 0===i||null===(l=i[e.name])||void 0===l?void 0:l.message):null)}),m&&r.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},r.createElement("div",null,N())),"desktop"===s&&!T&&r.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},r.createElement(t.SubmitBar,{className:"submit-bar-search",label:h("ES_COMMON_SEARCH"),disabled:!!Object.keys(A.errors).length||(()=>{var e;let t=!0;return Object.keys(C).forEach(e=>{!["locality","city"].includes(e)&&C[e]&&(t=!1)}),null==p||!p.find(e=>"locality"===e.name)||null!=C&&null!==(e=C.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!m&&r.createElement("div",null,N()))))),("mobile"===s||T)&&r.createElement(t.ActionBar,{className:"clear-search-container"},r.createElement("button",{className:"clear-search",style:{flex:1}},N(T)),r.createElement(t.SubmitBar,{disabled:!!Object.keys(A.errors).length,label:h("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},ft=["tableConfig","filterComponent"],mt=e=>{let{tableConfig:i,filterComponent:a}=e,l=d(e,ft);const{data:s,useNewInboxAPI:u}=l,{t:c}=o.useTranslation(),[p,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[m,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(l.EmptyResultInboxComp)}),[h,g]=n.useState(!1),y=r.useMemo(()=>l.isSearch?i.searchColumns(l):i.inboxColumns(l)||[],[]);let E;return l.isLoading?E=r.createElement(t.Loader,null):h?E=null:!s||0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?E=m&&r.createElement(m,{data:s})||(0===(null==s?void 0:s.length)||u&&null!=s&&s[0].dataEmpty?r.createElement(t.Card,{style:{marginTop:20}},c("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):r.createElement(t.Loader,null)):(null==s?void 0:s.length)>0&&(E=r.createElement(st,{t:c,data:s,columns:y,getCellProps:e=>({style:{minWidth:e.column.Header===c("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:l.onPageSizeChange,currentPage:l.currentPage,onNextPage:l.onNextPage,onPrevPage:l.onPrevPage,pageSizeLimit:l.pageSizeLimit,onSort:l.onSort,disableSort:l.disableSort,sortParams:l.sortParams,totalRecords:l.totalRecords})),r.createElement("div",{className:"inbox-container"},!l.isSearch&&r.createElement("div",{className:"filters-container"},r.createElement(ut,{parentRoute:l.parentRoute,businessService:l.moduleCode}),r.createElement("div",null,r.createElement(p,{defaultSearchParams:l.defaultSearchParams,onFilterChange:l.onFilterChange,searchParams:l.searchParams,type:"desktop",useNewInboxAPI:u,statusMap:u?null==s?void 0:s[0].statusMap:null,moduleCode:l.moduleCode}))),r.createElement("div",{style:{flex:1}},r.createElement(pt,{defaultSearchParams:l.defaultSearchParams,onSearch:e=>{l.onSearch(e),g(!1)},type:"desktop",searchFields:l.searchFields,isInboxPage:!(null!=l&&l.isSearch),searchParams:l.searchParams,clearSearch:()=>g(!0)}),r.createElement("div",{className:"result",style:{marginLeft:null!=l&&l.isSearch?"":"24px",flex:1}},E)))},vt=e=>{const{t:i}=o.useTranslation(),[a,l]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}});function s(){}return r.createElement(r.Fragment,null,r.createElement("div",{className:"filter"},r.createElement("div",{className:"filter-card"},r.createElement("div",{className:"heading"},r.createElement("div",{className:"filter-label"},i("SORT_BY"),":"),r.createElement("div",{className:"clearAll",onClick:s},i("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&r.createElement("span",{className:"clear-search",onClick:s},i("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&r.createElement("span",{onClick:e.onClose},r.createElement(t.CloseSvg,null))),r.createElement("div",null,r.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:i("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:i("ES_INBOX_DATE_LATEST_LAST")}]})))))},ht=e=>{let{t:o,data:i,onFilterChange:a,onSearch:l,onSort:s,serviceRequestIdKey:u,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:f,searchFields:m,sortParams:v,linkPrefix:h,filterComponent:g}=e;const[y,E]=n.useState(p?"SEARCH":""),[S,b]=n.useState(!!p),[_,A]=n.useState(v),[D]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(g)});n.useEffect(()=>{y&&b(!0)},[y]);const C=()=>{b(!1),E(""),A(v)};if(d)return r.createElement(t.Loader,null);let T;return i&&0!==(null==i?void 0:i.length)?i&&(null==i?void 0:i.length)>0&&(T=r.createElement(t.DetailsCard,{data:i,serviceRequestIdKey:u,linkPrefix:h||"/digit-ui/employee/ptr/"})):T=r.createElement(t.Card,{style:{marginTop:20}},o("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))),r.createElement(r.Fragment,null,r.createElement("div",{className:"searchBox"},l&&r.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{E("SEARCH"),b(!0)}}),!p&&a&&r.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{E("FILTER"),b(!0)}}),r.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{E("SORT"),b(!0)}})),T,S&&r.createElement(t.PopUp,null,"FILTER"===y&&r.createElement("div",{className:"popup-module"},r.createElement(D,{onFilterChange:e=>{a(e),b(!1)},Close:C,type:"mobile",searchParams:f})),"SORT"===y&&r.createElement("div",{className:"popup-module"},r.createElement(vt,{type:"mobile",sortParams:v,onClose:C,onSort:s})),"SEARCH"===y&&r.createElement("div",{className:"popup-module"},r.createElement(pt,{type:"mobile",onClose:C,onSearch:l,isFstpOperator:c,searchParams:f,searchFields:m}))))},gt=e=>{let{linkPrefix:a,classNameForMobileView:l=""}=e;const{t:s}=o.useTranslation(),u=[{text:s("ES_TITLE_ADD_BOOKING"),link:"/digit-ui/employee/ads/bookad"},{text:s("ES_TITILE_SEARCH_APPLICATION"),link:a+"/my-applications"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];u.forEach(t=>{var n;t.accessTo?(n=t.accessTo,p.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),d(e)},[]),r.createElement(t.Card,{className:"employeeCard filter"},r.createElement("div",{className:"complaint-links-container "+l},r.createElement("div",{className:"header"},r.createElement("span",{className:"logo"},r.createElement(t.ShippingTruck,null))," ",r.createElement("span",{className:"text"},s("ES_TITLE_ADD_BOOKING"))),r.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:o}=e;return r.createElement("span",{className:"link",key:t},r.createElement(i.Link,{to:n},o))}))))},yt=e=>{let{data:t,isLoading:n,isSearch:i,searchFields:a,onFilterChange:l,onSearch:s,onSort:u,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:f,tableConfig:m,filterComponent:v}=e;const{t:h}=o.useTranslation();return r.createElement("div",{style:{padding:0}},r.createElement("div",{className:"inbox-container"},r.createElement("div",{className:"filters-container"},!i&&r.createElement(gt,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),r.createElement(ht,{t:h,data:null==t?void 0:t.map(e=>{const t={};return(i?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:l,isLoading:n,isSearch:i,onSearch:s,onSort:u,searchParams:d,searchFields:a,linkPrefix:f,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:v}))))},Et=["isFetching","isLoading","searchResponseKey","data","searchFields"],St=e=>{var i,a,l,s,u;let{useNewInboxAPI:p,parentRoute:f,moduleCode:m="ADV",initialStates:v={},filterComponent:h,isInbox:g,rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:_,middlewaresWf:A,middlewareSearch:D,EmptyResultInboxComp:C}=e;const T=Digit.ULBService.getCurrentTenantId(),{t:x}=o.useTranslation(),[N,w]=n.useState(()=>g?{}:{enabled:!1}),[I,L]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("ADSInboxTableConfig")}),[k,O]=n.useState(v.pageOffset||0),[R,P]=n.useState(v.pageSize||10),[M,B]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[F,j]=n.useState(v.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),U=H?{limit:100,offset:0,sortBy:null==M||null===(i=M[0])||void 0===i?void 0:i.id,sortOrder:null!=M&&null!==(a=M[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:R,offset:k,sortBy:null==M||null===(l=M[0])||void 0===l?void 0:l.id,sortOrder:null!=M&&null!==(s=M[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const z=p?Digit.Hooks.useNewInboxGeneral({tenantId:T,ModuleCode:m,filters:c({},F,U,{sortParams:M},F.wfFilters||{})}):Digit.Hooks.useInboxGeneral({tenantId:T,businessService:m,isInbox:g,filters:c({},F,U,{sortParams:M},F.wfFilters||{}),rawWfHandler:y,rawSearchHandler:E,combineResponse:S,wfConfig:b,searchConfig:c({},N,_),middlewaresWf:A,middlewareSearch:D}),{isLoading:W,data:q,searchFields:V}=z,G=d(z,Et);n.useEffect(()=>{O(0)},[F]);const K=e=>{let t=e.delete,n=c({},F,e);t&&t.forEach(e=>delete n[e]),delete e.delete,j(c({},n)),w({enabled:!0})},Y=n.useCallback(e=>{0!==e.length&&B(e)},[]);var $;if(null!==(null==G||null===(u=G.data)||void 0===u?void 0:u.length))return H?r.createElement(yt,{data:q,isLoading:W,isSearch:!g,searchFields:V,onFilterChange:K,onSearch:K,onSort:Y,parentRoute:f,searchParams:F,sortParams:M,linkPrefix:f+"/application-details/",tableConfig:null!=G&&G.tableConfig?null==G?void 0:G.tableConfig:I(x).ADS,filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:p}):r.createElement("div",null,g&&r.createElement(t.Header,null,x("ES_COMMON_INBOX")),r.createElement(mt,{moduleCode:m,data:q,tableConfig:I(x).ADS,isLoading:W,defaultSearchParams:v.searchParams,isSearch:!g,onFilterChange:K,searchFields:V,onSearch:K,onSort:Y,onNextPage:()=>{O(e=>e+R)},onPrevPage:()=>{O(e=>e-R)},currentPage:Math.floor(k/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{P(Number(e.target.value))},parentRoute:f,searchParams:F,sortParams:M,totalRecords:Number(null==q||null===($=q[0])||void 0===$?void 0:$.totalCount),filterComponent:h,EmptyResultInboxComp:C,useNewInboxAPI:p}))},bt=e=>{var n,a,l,s,u,d,p,f,m,v,h,g;let{path:y,userType:E}=e;o.useTranslation();const S=i.useLocation();sessionStorage.removeItem("revalidateddone"),window.Digit.Utils.browser.isMobile();const b=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("NewADSStepperForm"),_=(null===(l=Digit)||void 0===l||null===(s=l.ComponentRegistryService)||void 0===s||s.getComponent("NewSiteMasterStepperForm"),null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewSiteInspectionStepperForm")),D=(null===(p=Digit)||void 0===p||null===(f=p.ComponentRegistryService)||void 0===f||f.getComponent("ApplicationOverview"),null===(m=Digit)||void 0===m||null===(v=m.ComponentRegistryService)||void 0===v?void 0:v.getComponent("ADSResponseCitizen")),C=null===(h=Digit)||void 0===h||null===(g=h.ComponentRegistryService)||void 0===g?void 0:g.getComponent("ApplicationDetails"),T=window.location.href.includes("ads/response"),x=window.location.href.includes("searchad")||window.location.href.includes("modify-application")||window.location.href.includes("ads/application-details"),N={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ADV"],applicationStatus:[],locality:[]}};return r.createElement(i.Switch,null,r.createElement(t.AppContainer,null,r.createElement(r.Fragment,null,r.createElement("div",{className:"ground-container"},T?null:r.createElement("div",{style:x?{marginLeft:"12px",display:"flex",alignItems:"center"}:{marginLeft:"-4px",display:"flex",alignItems:"center"}},r.createElement(t.BackButton,{location:S})),r.createElement(t.PrivateRoute,{path:y+"/bookad",component:e=>r.createElement(b,c({},e,{userType:E}))}),r.createElement(t.PrivateRoute,{path:y+"/my-applications",component:e=>r.createElement(A,c({},e,{userType:"employee",parentRoute:y}))}),r.createElement(t.PrivateRoute,{path:y+"/applicationsearch/application-details/:id",component:()=>r.createElement(C,{parentRoute:y})}),r.createElement(t.PrivateRoute,{path:y+"/adsservice/:response/:bookingNo",component:D}),r.createElement(t.PrivateRoute,{path:y+"/site-inspection-details",component:_}),r.createElement(t.PrivateRoute,{path:y+"/inbox",component:()=>r.createElement(St,{useNewInboxAPI:!0,parentRoute:y,businessService:"ADV",filterComponent:"ADS_INBOX_FILTER",initialStates:N,isInbox:!0})}),r.createElement(t.PrivateRoute,{path:y+"/searchold",component:()=>r.createElement(St,{parentRoute:y,businessService:"ads",middlewareSearch:searchMW,initialStates:N,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})})))))},_t=e=>{let{t:t,createTime:o,onExpire:i}=e;const a=o?new Date(o).getTime()+18e5:null,[l,s]=n.useState(null);if(n.useEffect(()=>{if(!a)return;const e=()=>{const e=a-Date.now();s(e),e<=0&&"function"==typeof i&&i(!0)};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[a,i]),!a)return null;if(null!==l&&l<=0)return r.createElement("span",{style:{fontSize:"16px",color:"red",fontWeight:800}},t("ADS_SLOTS_EXPIRED"));if(null===l)return null;const u=null===Math||void 0===Math?void 0:Math.floor(l/6e4),c=null===Math||void 0===Math?void 0:Math.floor(l%6e4/1e3).toString().padStart(2,"0");return r.createElement("span",{style:{color:l<=6e4?"red":"#2947a3",fontWeight:600,fontSize:"14px",marginLeft:"8px"}},t("ADS_PAYMENT_TIMER"),r.createElement("span",{style:{fontSize:"16px",fontWeight:900,color:"red",marginLeft:"4px"}},u,":",c))},At=e=>{var a,l,s;let{application:u,buttonLabel:c}=e;const{t:d}=o.useTranslation(),p=i.useHistory(),[f,m]=n.useState(null);n.useEffect(()=>{if(f){const e=setTimeout(()=>{m(null)},2e3);return()=>clearTimeout(e)}},[f]);const v=new Date(null==u?void 0:u.applicationDate).toLocaleDateString(),[h,g]=n.useState(!1);return r.createElement(t.Card,null,"PENDING_FOR_PAYMENT"===u.bookingStatus&&(null==u||null===(a=u.auditDetails)||void 0===a?void 0:a.createdTime)&&r.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},r.createElement(_t,{t:d,createTime:null==u||null===(l=u.auditDetails)||void 0===l?void 0:l.createdTime,onExpire:e=>g(e)})),r.createElement(t.KeyNote,{keyValue:d("ADS_BOOKING_NO"),note:null==u?void 0:u.bookingNo}),r.createElement(t.KeyNote,{keyValue:d("ADS_APPLICANT_NAME"),note:null==u||null===(s=u.applicantDetail)||void 0===s?void 0:s.applicantName}),r.createElement(t.KeyNote,{keyValue:d("CS_APPLICATION_DETAILS_APPLICATION_DATE"),note:v}),r.createElement(t.KeyNote,{keyValue:d("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:d(""+(null==u?void 0:u.bookingStatus))}),r.createElement("div",null,r.createElement(i.Link,{to:"/digit-ui/citizen/ads/application/"+(null==u?void 0:u.bookingNo)+"/"+(null==u?void 0:u.tenantId)},r.createElement(t.SubmitBar,{label:c})),("/mybookingsPAYMENT_FAILED"===u.bookingStatus||"PENDING_FOR_PAYMENT"===u.bookingStatus)&&r.createElement(t.SubmitBar,{label:d("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{p.push("/digit-ui/citizen/payment/my-bills/adv-services/"+(null==u?void 0:u.bookingNo))},style:{margin:"20px"},disabled:h})),f&&r.createElement(t.Toast,{error:f.error,warning:f.warning,label:d(f.label),onClose:()=>{m(null)}}))};var Dt,Ct=Array.isArray,Tt="object"==typeof w&&w&&w.Object===Object&&w,xt="object"==typeof self&&self&&self.Object===Object&&self,Nt=Tt||xt||Function("return this")(),wt=Nt.Symbol,It=Object.prototype,Lt=It.hasOwnProperty,kt=It.toString,Ot=wt?wt.toStringTag:void 0,Rt=Object.prototype.toString,Pt=wt?wt.toStringTag:void 0,Mt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Pt&&Pt in Object(e)?function(e){var t=Lt.call(e,Ot),n=e[Ot];try{e[Ot]=void 0;var r=!0}catch(e){}var o=kt.call(e);return r&&(t?e[Ot]=n:delete e[Ot]),o}(e):function(e){return Rt.call(e)}(e)},Bt=function(e){return null!=e&&"object"==typeof e},Ft=function(e){return"symbol"==typeof e||Bt(e)&&"[object Symbol]"==Mt(e)},jt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ht=/^\w*$/,Ut=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},zt=Nt["__core-js_shared__"],Wt=(Dt=/[^.]+$/.exec(zt&&zt.keys&&zt.keys.IE_PROTO||""))?"Symbol(src)_1."+Dt:"",qt=Function.prototype.toString,Vt=function(e){if(null!=e){try{return qt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Gt=/^\[object .+?Constructor\]$/,Kt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ut(e)||(t=e,Wt&&Wt in t))&&(function(e){if(!Ut(e))return!1;var t=Mt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?Kt:Gt).test(Vt(e));var t}(n)?n:void 0},$t=Yt(Object,"create"),Xt=Object.prototype.hasOwnProperty,Zt=Object.prototype.hasOwnProperty;function Jt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jt.prototype.clear=function(){this.__data__=$t?$t(null):{},this.size=0},Jt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Jt.prototype.get=function(e){var t=this.__data__;if($t){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Xt.call(t,e)?t[e]:void 0},Jt.prototype.has=function(e){var t=this.__data__;return $t?void 0!==t[e]:Zt.call(t,e)},Jt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=$t&&void 0===t?"__lodash_hash_undefined__":t,this};var Qt=Jt,en=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(o=t)||r!=r&&o!=o)return n;var r,o;return-1},tn=Array.prototype.splice;function nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nn.prototype.clear=function(){this.__data__=[],this.size=0},nn.prototype.delete=function(e){var t=this.__data__,n=en(t,e);return!(n<0||(n==t.length-1?t.pop():tn.call(t,n,1),--this.size,0))},nn.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?void 0:t[n][1]},nn.prototype.has=function(e){return en(this.__data__,e)>-1},nn.prototype.set=function(e,t){var n=this.__data__,r=en(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var rn=nn,on=Yt(Nt,"Map"),an=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=function(){this.size=0,this.__data__={hash:new Qt,map:new(on||rn),string:new Qt}},ln.prototype.delete=function(e){var t=an(this,e).delete(e);return this.size-=t?1:0,t},ln.prototype.get=function(e){return an(this,e).get(e)},ln.prototype.has=function(e){return an(this,e).has(e)},ln.prototype.set=function(e,t){var n=an(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var sn=ln;function un(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(un.Cache||sn),n}un.Cache=sn;var cn,dn,pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/\\(\\)?/g,mn=(cn=un(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(pn,function(e,n,r,o){t.push(r?o.replace(fn,"$1"):n||e)}),t},function(e){return 500===dn.size&&dn.clear(),e}),dn=cn.cache,cn),vn=wt?wt.prototype:void 0,hn=vn?vn.toString:void 0,gn=function(e){if("string"==typeof e||Ft(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},yn=function(e,t,n){var r=null==e?void 0:function(e,t){for(var n=0,r=(t=function(e,t){return Ct(e)?e:function(e,t){if(Ct(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ft(e))||Ht.test(e)||!jt.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:mn(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(Ct(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,e)+"";if(Ft(t))return hn?hn.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<r;)e=e[gn(t[n++])];return n&&n==r?e:void 0}(e,t);return void 0===r?n:r},En=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then};let Sn;const bn=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var _n=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},An=function(e){return bn[e]},Dn=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},Cn=function(){return void 0!==Sn},Tn=function(e){return Sn(e)},xn=I(function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}});function Nn(){this.buffer=[],this.length=0}Nn.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var wn=Nn;function In(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}In.prototype.set=function(e,t,n,r){const o=e*this.size+t;this.data[o]=n,r&&(this.reservedBit[o]=!0)},In.prototype.get=function(e,t){return this.data[e*this.size+t]},In.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},In.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Ln=In,kn=I(function(e,t){const n=_n;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),o=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e<t-1;e++)i[e]=i[e-1]-o;return i.push(6),i.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),o=r.length;for(let e=0;e<o;e++)for(let t=0;t<o;t++)0===e&&0===t||0===e&&t===o-1||e===o-1&&0===t||n.push([r[e],r[t]]);return n}});const On=_n;var Rn=I(function(e,t){function n(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let n=0,r=0,o=0,i=null,a=null;for(let l=0;l<t;l++){r=o=0,i=a=null;for(let s=0;s<t;s++){let t=e.get(l,s);t===i?r++:(r>=5&&(n+=r-5+3),i=t,r=1),t=e.get(s,l),t===a?o++:(o>=5&&(n+=o-5+3),a=t,o=1)}r>=5&&(n+=r-5+3),o>=5&&(n+=o-5+3)}return n},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){const t=e.get(r,o)+e.get(r,o+1)+e.get(r+1,o)+e.get(r+1,o+1);4!==t&&0!==t||n++}return 3*n},t.getPenaltyN3=function(e){const t=e.size;let n=0,r=0,o=0;for(let i=0;i<t;i++){r=o=0;for(let a=0;a<t;a++)r=r<<1&2047|e.get(i,a),a>=10&&(1488===r||93===r)&&n++,o=o<<1&2047|e.get(a,i),a>=10&&(1488===o||93===o)&&n++}return 40*n},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return 10*Math.abs(Math.ceil(100*t/n/5)-10)},t.applyMask=function(e,t){const r=t.size;for(let o=0;o<r;o++)for(let i=0;i<r;i++)t.isReserved(i,o)||t.xor(i,o,n(e,i,o))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let o=0,i=Infinity;for(let a=0;a<r;a++){n(a),t.applyMask(a,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),r<i&&(i=r,o=a)}return o}});const Pn=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Mn=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];var Bn=function(e,t){switch(t){case xn.L:return Pn[4*(e-1)+0];case xn.M:return Pn[4*(e-1)+1];case xn.Q:return Pn[4*(e-1)+2];case xn.H:return Pn[4*(e-1)+3];default:return}},Fn=function(e,t){switch(t){case xn.L:return Mn[4*(e-1)+0];case xn.M:return Mn[4*(e-1)+1];case xn.Q:return Mn[4*(e-1)+2];case xn.H:return Mn[4*(e-1)+3];default:return}};const jn=new Uint8Array(512),Hn=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)jn[t]=e,Hn[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)jn[e]=jn[e-255]}();var Un=function(e){return jn[e]},zn=function(e,t){return 0===e||0===t?0:jn[Hn[e]+Hn[t]]},Wn=I(function(e,t){t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let r=0;r<e.length;r++)for(let o=0;o<t.length;o++)n[r+o]^=zn(e[r],t[o]);return n},t.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const e=n[0];for(let r=0;r<t.length;r++)n[r]^=zn(t[r],e);let r=0;for(;r<n.length&&0===n[r];)r++;n=n.slice(r)}return n},t.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let r=0;r<e;r++)n=t.mul(n,new Uint8Array([1,Un(r)]));return n}});function qn(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}qn.prototype.initialize=function(e){this.degree=e,this.genPoly=Wn.generateECPolynomial(this.degree)},qn.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Wn.mod(t,this.genPoly),r=this.degree-n.length;if(r>0){const e=new Uint8Array(this.degree);return e.set(n,r),e}return n};var Vn=qn,Gn=function(e){return!isNaN(e)&&e>=1&&e<=40};let Kn="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Kn=Kn.replace(/u/g,"\\u");const Yn="(?:(?![A-Z0-9 $%*+\\-./:]|"+Kn+")(?:.|[\r\n]))+";var $n=new RegExp(Kn,"g"),Xn=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Zn=new RegExp(Yn,"g"),Jn=new RegExp("[0-9]+","g"),Qn=new RegExp("[A-Z $%*+\\-./:]+","g");const er=new RegExp("^"+Kn+"$"),tr=new RegExp("^[0-9]+$"),nr=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");var rr={KANJI:$n,BYTE_KANJI:Xn,BYTE:Zn,NUMERIC:Jn,ALPHANUMERIC:Qn,testKanji:function(e){return er.test(e)},testNumeric:function(e){return tr.test(e)},testAlphanumeric:function(e){return nr.test(e)}},or=I(function(e,t){t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Gn(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return rr.testNumeric(e)?t.NUMERIC:rr.testAlphanumeric(e)?t.ALPHANUMERIC:rr.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}}),ir=I(function(e,t){const n=Dn(7973);function r(e,t){return or.getCharCountIndicator(e,t)+4}function o(e,t){let n=0;return e.forEach(function(e){const o=r(e.mode,t);n+=o+e.getBitsLength()}),n}t.from=function(e,t){return Gn(e)?parseInt(e,10):t},t.getCapacity=function(e,t,n){if(!Gn(e))throw new Error("Invalid QR Code version");void 0===n&&(n=or.BYTE);const o=8*(An(e)-Fn(e,t));if(n===or.MIXED)return o;const i=o-r(n,e);switch(n){case or.NUMERIC:return Math.floor(i/10*3);case or.ALPHANUMERIC:return Math.floor(i/11*2);case or.KANJI:return Math.floor(i/13);case or.BYTE:default:return Math.floor(i/8)}},t.getBestVersionForData=function(e,n){let r;const i=xn.from(n,xn.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(o(e,r)<=t.getCapacity(r,n,or.MIXED))return r}(e,i);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,n,r){for(let o=1;o<=40;o++)if(n<=t.getCapacity(o,r,e))return o}(r.mode,r.getLength(),i)},t.getEncodedBits=function(e){if(!Gn(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;Dn(t)-n>=0;)t^=7973<<Dn(t)-n;return e<<12|t}});const ar=Dn(1335);function lr(e){this.mode=or.NUMERIC,this.data=e.toString()}lr.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},lr.prototype.getLength=function(){return this.data.length},lr.prototype.getBitsLength=function(){return lr.getBitsLength(this.data.length)},lr.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);const o=this.data.length-t;o>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*o+1))};var sr=lr;const ur=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function cr(e){this.mode=or.ALPHANUMERIC,this.data=e}cr.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},cr.prototype.getLength=function(){return this.data.length},cr.prototype.getBitsLength=function(){return cr.getBitsLength(this.data.length)},cr.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*ur.indexOf(this.data[t]);n+=ur.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(ur.indexOf(this.data[t]),6)};var dr=cr;function pr(e){this.mode=or.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}pr.getBitsLength=function(e){return 8*e},pr.prototype.getLength=function(){return this.data.length},pr.prototype.getBitsLength=function(){return pr.getBitsLength(this.data.length)},pr.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var fr=pr;function mr(e){this.mode=or.KANJI,this.data=e}mr.getBitsLength=function(e){return 13*e},mr.prototype.getLength=function(){return this.data.length},mr.prototype.getBitsLength=function(){return mr.getBitsLength(this.data.length)},mr.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Tn(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var vr=mr,hr=I(function(e){var t={single_source_shortest_paths:function(e,n,r){var o={},i={};i[n]=0;var a,l,s,u,c,d,p=t.PriorityQueue.make();for(p.push(n,0);!p.empty();)for(s in u=(a=p.pop()).cost,c=e[l=a.value]||{})c.hasOwnProperty(s)&&(d=u+c[s],(void 0===i[s]||i[s]>d)&&(i[s]=d,p.push(s,d),o[s]=l));if(void 0!==r&&void 0===i[r]){var f=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(f)}return o},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),r=e[r];return n.reverse(),n},find_path:function(e,n,r){var o=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,o={};for(n in e=e||{},r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=e.sorter||r.default_sorter,o},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}),gr=I(function(e,t){function n(e){return unescape(encodeURIComponent(e)).length}function r(e,t,n){const r=[];let o;for(;null!==(o=e.exec(n));)r.push({data:o[0],index:o.index,mode:t,length:o[0].length});return r}function o(e){const t=r(rr.NUMERIC,or.NUMERIC,e),n=r(rr.ALPHANUMERIC,or.ALPHANUMERIC,e);let o,i;return Cn()?(o=r(rr.BYTE,or.BYTE,e),i=r(rr.KANJI,or.KANJI,e)):(o=r(rr.BYTE_KANJI,or.BYTE,e),i=[]),t.concat(n,o,i).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function i(e,t){switch(t){case or.NUMERIC:return sr.getBitsLength(e);case or.ALPHANUMERIC:return dr.getBitsLength(e);case or.KANJI:return vr.getBitsLength(e);case or.BYTE:return fr.getBitsLength(e)}}function a(e,t){let n;const r=or.getBestModeForData(e);if(n=or.from(t,r),n!==or.BYTE&&n.bit<r.bit)throw new Error('"'+e+'" cannot be encoded with mode '+or.toString(n)+".\n Suggested mode is: "+or.toString(r));switch(n!==or.KANJI||Cn()||(n=or.BYTE),n){case or.NUMERIC:return new sr(e);case or.ALPHANUMERIC:return new dr(e);case or.KANJI:return new vr(e);case or.BYTE:return new fr(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(a(t,null)):t.data&&e.push(a(t.data,t.mode)),e},[])},t.fromString=function(e,r){const a=function(e,t){const n={},r={start:{}};let o=["start"];for(let a=0;a<e.length;a++){const l=e[a],s=[];for(let e=0;e<l.length;e++){const u=l[e],c=""+a+e;s.push(c),n[c]={node:u,lastCount:0},r[c]={};for(let e=0;e<o.length;e++){const a=o[e];n[a]&&n[a].node.mode===u.mode?(r[a][c]=i(n[a].lastCount+u.length,u.mode)-i(n[a].lastCount,u.mode),n[a].lastCount+=u.length):(n[a]&&(n[a].lastCount=u.length),r[a][c]=i(u.length,u.mode)+4+or.getCharCountIndicator(u.mode,t))}}o=s}for(let e=0;e<o.length;e++)r[o[e]].end=0;return{map:r,table:n}}(function(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];switch(o.mode){case or.NUMERIC:t.push([o,{data:o.data,mode:or.ALPHANUMERIC,length:o.length},{data:o.data,mode:or.BYTE,length:o.length}]);break;case or.ALPHANUMERIC:t.push([o,{data:o.data,mode:or.BYTE,length:o.length}]);break;case or.KANJI:t.push([o,{data:o.data,mode:or.BYTE,length:n(o.data)}]);break;case or.BYTE:t.push([{data:o.data,mode:or.BYTE,length:n(o.data)}])}}return t}(o(e,Cn())),r),l=hr.find_path(a.map,"start","end"),s=[];for(let e=1;e<l.length-1;e++)s.push(a.table[l[e]].node);return t.fromArray(s.reduce(function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[]))},t.rawSplit=function(e){return t.fromArray(o(e,Cn()))}});function yr(e,t,n){const r=e.size,o=function(e,t){const n=e.bit<<3|t;let r=n<<10;for(;Dn(r)-ar>=0;)r^=1335<<Dn(r)-ar;return 21522^(n<<10|r)}(t,n);let i,a;for(i=0;i<15;i++)a=1==(o>>i&1),e.set(i<6?i:i<8?i+1:r-15+i,8,a,!0),e.set(8,i<8?r-i-1:i<9?15-i-1+1:15-i-1,a,!0);e.set(r-8,8,1,!0)}var Er=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,r,o=xn.M;return void 0!==t&&(o=xn.from(t.errorCorrectionLevel,xn.M),n=ir.from(t.version),r=Rn.from(t.maskPattern),t.toSJISFunc&&function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Sn=e}(t.toSJISFunc)),function(e,t,n,r){let o;if(Array.isArray(e))o=gr.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let r=t;if(!r){const t=gr.rawSplit(e);r=ir.getBestVersionForData(t,n)}o=gr.fromString(e,r||40)}}const i=ir.getBestVersionForData(o,n);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<i)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+i+".\n")}else t=i;const a=function(e,t,n){const r=new wn;n.forEach(function(t){r.put(t.mode.bit,4),r.put(t.getLength(),or.getCharCountIndicator(t.mode,e)),t.write(r)});const o=8*(An(e)-Fn(e,t));for(r.getLengthInBits()+4<=o&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(0);const i=(o-r.getLengthInBits())/8;for(let e=0;e<i;e++)r.put(e%2?17:236,8);return function(e,t,n){const r=An(t),o=r-Fn(t,n),i=Bn(t,n),a=i-r%i,l=Math.floor(r/i),s=Math.floor(o/i),u=s+1,c=l-s,d=new Vn(c);let p=0;const f=new Array(i),m=new Array(i);let v=0;const h=new Uint8Array(e.buffer);for(let e=0;e<i;e++){const t=e<a?s:u;f[e]=h.slice(p,p+t),m[e]=d.encode(f[e]),p+=t,v=Math.max(v,t)}const g=new Uint8Array(r);let y,E,S=0;for(y=0;y<v;y++)for(E=0;E<i;E++)y<f[E].length&&(g[S++]=f[E][y]);for(y=0;y<c;y++)for(E=0;E<i;E++)g[S++]=m[E][y];return g}(r,e,t)}(t,n,o),l=_n(t),s=new Ln(l);return function(e,t){const n=e.size,r=function(e){const t=On(e);return[[0,0],[t-7,0],[0,t-7]]}(t);for(let t=0;t<r.length;t++){const o=r[t][0],i=r[t][1];for(let t=-1;t<=7;t++)if(!(o+t<=-1||n<=o+t))for(let r=-1;r<=7;r++)i+r<=-1||n<=i+r||e.set(o+t,i+r,t>=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4,!0)}}(s,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(s),function(e,t){const n=kn.getPositions(t);for(let t=0;t<n.length;t++){const r=n[t][0],o=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)e.set(r+t,o+n,-2===t||2===t||-2===n||2===n||0===t&&0===n,!0)}}(s,t),yr(s,n,0),t>=7&&function(e,t){const n=e.size,r=ir.getEncodedBits(t);let o,i,a;for(let t=0;t<18;t++)o=Math.floor(t/3),i=t%3+n-8-3,a=1==(r>>t&1),e.set(o,i,a,!0),e.set(i,o,a,!0)}(s,t),function(e,t){const n=e.size;let r=-1,o=n-1,i=7,a=0;for(let l=n-1;l>0;l-=2)for(6===l&&l--;;){for(let n=0;n<2;n++)if(!e.isReserved(o,l-n)){let r=!1;a<t.length&&(r=1==(t[a]>>>i&1)),e.set(o,l-n,r),i--,-1===i&&(a++,i=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}(s,a),isNaN(r)&&(r=Rn.getBestMask(s,yr.bind(null,s,n))),Rn.applyMask(r,s),yr(s,n,r),{modules:s,version:t,errorCorrectionLevel:n,maskPattern:r,segments:o}}(e,n,o,r)},Sr=I(function(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=e.width&&e.width>=21?e.width:void 0;return{width:t,scale:t?4:e.scale||4,margin:null==e.margin||e.margin<0?4:e.margin,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const o=n.modules.size,i=n.modules.data,a=t.getScale(o,r),l=Math.floor((o+2*r.margin)*a),s=r.margin*a,u=[r.color.light,r.color.dark];for(let t=0;t<l;t++)for(let n=0;n<l;n++){let c=4*(t*l+n),d=r.color.light;t>=s&&n>=s&&t<l-s&&n<l-s&&(d=u[i[Math.floor((t-s)/a)*o+Math.floor((n-s)/a)]?1:0]),e[c++]=d.r,e[c++]=d.g,e[c++]=d.b,e[c]=d.a}}}),br=I(function(e,t){t.render=function(e,t,n){let r=n,o=t;void 0!==r||t&&t.getContext||(r=t,t=void 0),t||(o=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),r=Sr.getOptions(r);const i=Sr.getImageWidth(e.modules.size,r),a=o.getContext("2d"),l=a.createImageData(i,i);return Sr.qrToImageData(l.data,e,r),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,o,i),a.putImageData(l,0,0),o},t.renderToDataURL=function(e,n,r){let o=r;return void 0!==o||n&&n.getContext||(o=n,n=void 0),o||(o={}),t.render(e,n,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}});function _r(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function Ar(e,t,n){let r=e+t;return void 0!==n&&(r+=" "+n),r}function Dr(e,t,n,r,o){const i=[].slice.call(arguments,1),a=i.length,l="function"==typeof i[a-1];if(!l&&!En())throw new Error("Callback required as last argument");if(!l){if(a<1)throw new Error("Too few arguments provided");return 1===a?(n=t,t=r=void 0):2!==a||t.getContext||(r=n,n=t,t=void 0),new Promise(function(o,i){try{const i=Er(n,r);o(e(i,t,r))}catch(e){i(e)}})}if(a<2)throw new Error("Too few arguments provided");2===a?(o=n,n=t,t=r=void 0):3===a&&(t.getContext&&void 0===o?(o=r,r=void 0):(o=r,r=n,n=t,t=void 0));try{const i=Er(n,r);o(null,e(i,t,r))}catch(e){o(e)}}var Cr={create:Er,toCanvas:Dr.bind(null,br.render),toDataURL:Dr.bind(null,br.renderToDataURL),toString:Dr.bind(null,function(e,t,n){return function(e,t,n){const r=Sr.getOptions(t),o=e.modules.size,i=e.modules.data,a=o+2*r.margin,l=r.color.light.a?"<path "+_r(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",s="<path "+_r(r.color.dark,"stroke")+' d="'+function(e,t,n){let r="",o=0,i=!1,a=0;for(let l=0;l<e.length;l++){const s=Math.floor(l%t),u=Math.floor(l/t);s||i||(i=!0),e[l]?(a++,l>0&&s>0&&e[l-1]||(r+=i?Ar("M",s+n,.5+u+n):Ar("m",o,0),o=0,i=!1),s+1<t&&e[l+1]||(r+=Ar("h",a),a=0)):o++}return r}(i,o,r.margin)+'"/>';return'<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+'viewBox="0 0 '+a+" "+a+'" shape-rendering="crispEdges">'+l+s+"</svg>\n"}(e,n)})};const Tr=function(e,t){try{console.log("application",e);const n=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"});return Promise.resolve(Cr.toDataURL(window.location.href)).then(function(r){var o,i,a,l,s;const u="\n<html>\n <head>\n <title>"+t("ADS_ACKNOWLEDGMENT_FORM")+'</title>\n <style>\n @page { margin: 0.5in; }\n body { \n font-family: \'Arial\', sans-serif; \n margin: 0; \n padding: 20px;\n font-size: 14px;\n line-height: 1.6;\n }\n .acknowledgement-container {\n max-width: 800px;\n margin: 0 auto;\n border: 2px solid #333;\n padding: 30px;\n background: white;\n }\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n margin-bottom: 30px;\n border-bottom: 2px solid #333;\n padding-bottom: 20px;\n position: relative;\n }\n .header-left,\n .header-right {\n flex: 0 0 auto;\n }\n .header-center {\n text-align: center;\n flex: 1;\n }\n .title {\n font-size: 20px;\n font-weight: bold;\n margin: 10px 0;\n color: #333;\n }\n .subtitle {\n font-size: 16px;\n margin: 5px 0;\n color: #666;\n }\n .acknowledgement-text {\n margin: 20px 0;\n text-align: justify;\n font-size: 15px;\n }\n .details-table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n }\n .details-table th,\n .details-table td {\n padding: 12px;\n text-align: left;\n border: 1px solid #ddd;\n }\n .details-table th {\n background: #f5f5f5;\n font-weight: bold;\n width: 40%;\n }\n .footer {\n margin-top: 30px;\n text-align: center;\n font-size: 12px;\n color: #666;\n }\n @media print {\n body { background: white !important; }\n }\n </style>\n </head>\n <body>\n <div class="acknowledgement-container">\n <div class="header">\n <div class="header-left">\n <img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/'+(null==e?void 0:e.tenantId)+'/logo.png" \n style="width: 120px; height: 120px;" />\n </div>\n <div class="header-center">\n <div class="title">Advertisement and Hoarding Booking Acknowledgement</div>\n <div class="subtitle">Municipal Corporation</div>\n </div>\n <div class="header-right">\n <img src="'+r+'" style="width: 120px; height: 120px;" />\n </div>\n </div>\n\n <div class="acknowledgement-text">\n '+t("ADV_ACK_TEXT_2")+" \n </div>\n\n <h3>"+t("ADS_APPLICANT_DETAILS")+'</h3>\n <table class="details-table">\n <tr>\n <th>'+t("WS_COMMON_TABLE_COL_APP_NO_LABEL")+"</th>\n <td>"+((null==e?void 0:e.bookingNo)||"Not Available")+"</td>\n </tr>\n <tr>\n <th>"+t("BPA_BASIC_DETAILS_APPLICATION_DATE_LABEL")+"</th>\n <td>"+(null!=e&&e.applicationDate?new Date(null==e?void 0:e.applicationDate).toLocaleDateString("en-GB"):"N/A")+"</td>\n </tr>\n <tr>\n <th>"+t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL")+"</th>\n <td>"+((null==e||null===(o=e.applicantDetail)||void 0===o?void 0:o.applicantName)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("PDF_STATIC_LABEL_WS_CONSOLIDATED_CONCERNED_PLUMBER_CONTACT")+"</th>\n <td>"+((null==e||null===(i=e.applicantDetail)||void 0===i?void 0:i.applicantMobileNo)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("ADS_ALTERNATE_NUMBER")+"</th>\n <td>"+((null==e||null===(a=e.applicantDetail)||void 0===a?void 0:a.applicantAlternateMobileNo)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_EMAIL")+"</th>\n <td>"+((null==e||null===(l=e.applicantDetail)||void 0===l?void 0:l.applicantEmailId)||"Not Specified")+"</td>\n </tr>\n <tr>\n <th>"+t("TL_HOME_SEARCH_RESULTS_APP_STATUS_LABEL")+'</th>\n <td style="color: #28a745; font-weight: bold;">'+(t(null==e?void 0:e.bookingStatus)||"SUBMITTED")+"</td>\n </tr>\n </table>\n\n "+((null==e||null===(s=e.cartDetails)||void 0===s?void 0:s.length)>0?"\n <h3>"+t("ADVERTISEMENT_DETAILS")+'</h3>\n <table class="details-table">\n <tr>\n <th>'+t("ADS_AD_TYPE")+"</th>\n <th>"+t("CS_ADDCOMPLAINT_LOCATION")+"</th>\n <th>"+t("ADS_FACE_AREA")+"</th>\n <th>"+t("CHB_BOOKING_DATE")+"</th>\n <th>"+t("ADS_FROM_TIME")+"</th>\n <th>"+t("ADS_TO_TIME")+"</th>\n <th>"+t("ADS_NIGHT_LIGHT")+"</th>\n <th>"+t("PT_OWNERSHIP_INFO_NAME")+"</th>\n <th>"+t("POLE_NO")+"</th>\n </tr>\n "+e.cartDetails.map(e=>"\n <tr>\n <td>"+(t(e.addType)||"N/A")+"</td>\n <td>"+(t(e.location)||"N/A")+"</td>\n <td>"+(t(e.faceArea.replace(e.addType+"_",""))||"N/A")+"</td>\n <td>"+(e.bookingDate||"N/A")+"</td>\n <td>"+(e.bookingFromTime||"N/A")+"</td>\n <td>"+(e.bookingToTime||"N/A")+"</td>\n <td>"+(e.nightLight?"With Light":"Without Light")+"</td>\n <td>"+(e.advertisementName||"N/A")+"</td>\n <td>"+(e.poleNo||"N/A")+"</td>\n </tr>\n ").join("")+"\n </table>\n ":"")+'\n\n <div class="acknowledgement-text">\n '+t("ADV_ACK_TEXT_1")+'\n </div>\n \n <div class="footer">\n <p>Generated on: '+n+"</p>\n <p>Municipal Corporation</p>\n <p>This is a computer-generated document and does not require a signature.</p>\n </div>\n </div>\n </body>\n</html>\n",c=window.open("","_blank");c.document.write(u),c.document.close(),c.onload=()=>{setTimeout(()=>{c.print(),c.onafterprint=()=>{c.close()}},500)}})}catch(e){return Promise.reject(e)}},xr=e=>{let{cartDetails:o,t:i}=e;const a=e=>(null==e?void 0:e.id)+"_"+(null==e?void 0:e.bookingStartDate)+"_"+(null==e?void 0:e.bookingEndDate),[l,s]=n.useState(()=>null==o?void 0:o.map(e=>a(null==e?void 0:e.ad)));return r.createElement("div",{style:{marginTop:"1rem"}},0===(null==o?void 0:o.length)?r.createElement("p",{style:{padding:"12px",color:"#666"}},i("ADS_NO_ADVERTISMENT_DETAILS")):null==o?void 0:o.map((e,n)=>{var o,u,c,d,p,f;const m=a(null==e?void 0:e.ad),v=null==l?void 0:l.includes(m);return r.createElement("div",{key:n,style:{marginBottom:"16px",border:"1px solid #ddd",borderRadius:"8px",overflow:"hidden"}},r.createElement("div",{onClick:()=>(e=>{s(t=>null!=t&&t.includes(e)?null==t?void 0:t.filter(t=>t!==e):[...t,e])})(m),style:{background:"#f9f9f9",padding:"10px 14px",fontWeight:600,fontSize:"14px",borderBottom:"1px solid #ddd",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement("span",null,i(null!=(o=null==e||null===(u=e.ad)||void 0===u?void 0:u.name)?o:null==e||null===(c=e.ad)||void 0===c?void 0:c.location),null!=e&&null!==(d=e.ad)&&void 0!==d&&d.amount?" — ₹"+(1.18*(null==e||null===(p=e.ad)||void 0===p?void 0:p.amount)*(null==e||null===(f=e.slots)||void 0===f?void 0:f.length)).toFixed(2):""),r.createElement("span",{style:{fontSize:"18px"}},v?"▾":"▸")),v&&r.createElement("div",{style:{overflowX:"auto"}},r.createElement(t.Table,{t:i,data:e.slots,columns:[{Header:i("ADS_DATE"),accessor:"bookingDate"},{Header:i("ADS_LOCATION"),accessor:"location",Cell:e=>{let{value:t}=e;return i(t||"N/A")}},{Header:i("ADS_FACE_AREA"),accessor:"faceArea",Cell:e=>{let{value:t}=e;return i((null==t?void 0:t.replaceAll("_"," "))||"N/A")}},{Header:i("ADS_TYPE"),accessor:"addType"},{Header:i("ADS_NIGHT_LIGHT"),accessor:e=>i(e.nightLight?"ADS_YES":"ADS_NO")}],disableSort:!0,isPaginationRequired:!1,getCellProps:e=>({style:{padding:"12px 14px",fontSize:"14px",borderBottom:"1px solid #f0f0f0",textAlign:"left",whiteSpace:"nowrap"}})})))}))},Nr=["tenantId","payments"],wr=["tenantId","payments"],Ir=e=>r.createElement("h1",{className:"heading-m"},e.label),Lr=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},r.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),kr=e=>r.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},r.createElement(Lr,null)),Or=e=>{var o,i,a;let{t:l,action:s,tenantId:u,closeModal:d,submitAction:p,applicationData:f,businessService:m,workflowActions:v,showToast:h,closeToast:g,errors:y}=e;const[E,S]=n.useState({}),[b,_]=n.useState({}),[A,D]=n.useState([]),[C,T]=n.useState({}),[x,N]=n.useState(null),[w,I]=n.useState(null),[L,k]=n.useState(null),[O,R]=n.useState([]),[P,M]=n.useState(null),B=new Set(["SUBMIT","INITIATE","PAY"]),F=(null==s?void 0:s.fromStateCode)||(null==s||null===(o=s._rawStateObj)||void 0===o?void 0:o.state)||null,j=(null==s?void 0:s.toStateCode)||null,H=(null==s?void 0:s.status)||(B.has(null==s?void 0:s.action)?j||F||(null==s?void 0:s.nextState):F||j||(null==s?void 0:s.nextState)),{data:U}=Digit.Hooks.useEmployeeSearch(u,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),{data:z}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'ADV')]"}]}]}});n.useEffect(()=>{var e;z&&z["egf-master"]&&R(null===(e=z["egf-master"])||void 0===e?void 0:e.FinancialYear)},[z]);const{data:W}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function q(e){N(e.target.files[0])}return n.useEffect(()=>{if(U&&W){var e;const t=W["common-masters"].Department;D(null==U||null===(e=U.Employees)||void 0===e?void 0:e.map(e=>{var n,r,o;const i=null==e||null===(n=e.assignments)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===i);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[U]),n.useEffect(()=>{!function(){try{k(null);const e=function(){if(x){const e=function(){if(x.size>=5242880)k(l("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=tt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",x,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):k(l("CS_FILE_UPLOAD_ERROR"))})},function(){k(l("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[x]),n.useEffect(()=>{v&&v.length>0&&v.find(e=>e.action===(null==s?void 0:s.action))},[v,s]),n.useEffect(()=>{s&&S((e=>{let{t:n,action:o,approvers:i,selectedApprover:a,setSelectedApprover:l,selectFile:s,uploadedFile:u,setUploadedFile:c}=e,d=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SENDBACK"!=(null==o?void 0:o.action)||(d=!1),o.isTerminateState&&(d=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:""+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:d?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:d?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:d?r.createElement(t.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:l,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:r.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{c(null)},message:u?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:l,action:s,approvers:A,selectedApprover:C,setSelectedApprover:T,selectFile:q,uploadedFile:w,setUploadedFile:I,businessService:m}))},[s,A,O,P,w]),s&&E.form?r.createElement(t.Modal,{headerBarMain:r.createElement(Ir,{label:l(E.label.heading)}),headerBarEnd:r.createElement(kr,{onClick:d}),actionCancelLabel:l(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:l(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},r.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){f=c({},f,{action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,status:H,wfDocuments:w?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==x?void 0:x.name,fileStoreId:w}]:null}),p({Licenses:[f]})},defaultValues:b,formId:"modal-action"}),h&&r.createElement(t.Toast,{error:"error"===h.key,label:y,onClose:g})):r.createElement(t.Loader,null)};var Rr;!function(){try{Yt(Object,"defineProperty")({},"",{})}catch(e){}}(),Rr=function(){return arguments}(),Bt(Rr)&&Mt(Rr);var Pr=function(){return!1},Mr=(I(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?Nt.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Pr}),I(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n&&Tt.process,i=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),I(function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,o=r&&r.exports===n?Nt.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=i?i(n):new e.constructor(n);return e.copy(r),r}}),Yt(Nt,"DataView")),Br=Yt(Nt,"Promise"),Fr=Yt(Nt,"Set"),jr=Yt(Nt,"WeakMap"),Hr=Vt(Mr),Ur=Vt(on),zr=Vt(Br),Wr=Vt(Fr),qr=Vt(jr),Vr=Mt;(Mr&&"[object DataView]"!=Vr(new Mr(new ArrayBuffer(1)))||on&&"[object Map]"!=Vr(new on)||Br&&"[object Promise]"!=Vr(Br.resolve())||Fr&&"[object Set]"!=Vr(new Fr)||jr&&"[object WeakMap]"!=Vr(new jr))&&(Vr=function(e){var t=Mt(e),n="[object Object]"==t?e.constructor:void 0,r=n?Vt(n):"";if(r)switch(r){case Hr:return"[object DataView]";case Ur:return"[object Map]";case zr:return"[object Promise]";case Wr:return"[object Set]";case qr:return"[object WeakMap]"}return t});const Gr=["tenantId","payments"],Kr=["tenantId","payments"],Yr=e=>{let{children:t,currentStep:n=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),l=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},s={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},u={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),i.length);return r.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},r.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return r.createElement("div",{className:"step-content",key:t,style:(o=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:o?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},r.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:r.createElement("div",{className:"step-number",style:u}),r.createElement("div",{className:"step-label",style:s},a(i[t].stepLabel))),r.createElement("div",{className:"step-circle",style:l(t+1)},t+1,t<d-1&&r.createElement("div",{style:c})));var o})),r.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},$r=e=>{let{stepsList:t=[],onSubmit:n,step:i,setStep:a}=e;const l=t.filter(e=>e.isStepEnabled),{t:s}=o.useTranslation();function u(){i<l.length?d():i===l.length&&n()}function c(){i>1&&p()}const d=()=>a(i+1),p=()=>a(i-1);return r.createElement(Yr,{currentStep:i,nextStep:d,prevStep:p,stepsList:l},(()=>{var e,t;const n=l[i-1],{component:o,key:a,texts:d,currStepConfig:p}=n,f=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return r.createElement(r.Fragment,null,r.createElement(f,{config:{key:a,texts:d,component:o,currStepNumber:i,currStepConfig:p},onGoNext:u,onBackClick:c,t:s}))})())},Xr=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInCitizen:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:"penalty"}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Zr=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSCitizenSecond",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_APPLICANT_DETAILA",stepNumber:2,body:[{route:"owners",component:"ADSCitizenDetailsNew",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"ADSSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"ADSSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],Jr=(e,t)=>({type:"UPDATE_ADSNewApplication_FORM",payload:{key:e,value:t}}),Qr=e=>({type:"SET_ADSNewApplication_STEP",payload:e}),eo=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"ads",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_APPLICANT_DETAILA",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}]),to=[{head:"PET DETAILS",stepLabel:"ADS_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewADSStepFormTwo",key:"ads",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"OWNER DETAILS",stepLabel:"ES_APPLICANT_DETAILA",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewADSStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewADSStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewADSStepFormFive",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}],no=e=>{var o,i,l;let{t:u,goNext:d,currentStepData:p,onGoBack:f,onChange:m=(()=>{})}=e;const v=s.useDispatch(),h=Digit.UserService.getUser(),g=window.location.href.includes("citizen"),y=g?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),{mobileNumber:E,emailId:S,name:b}=null==h?void 0:h.info,[_,A]=n.useState(null),{control:D,handleSubmit:C,setValue:T,formState:{errors:x},trigger:N}=a.useForm({mode:"onChange",defaultValues:{name:g&&b||"",emailId:g&&S||"",mobileNumber:g&&E||"",address:"",pincode:""}});n.useEffect(()=>{if(null!=p&&p.CreatedResponse){const e=null==p?void 0:p.CreatedResponse;null!=e&&e.address&&(T("address",e.address.addressLine1||""),T("pincode",e.address.pincode||"")),null!=e&&e.applicantDetail&&(T("name",e.applicantDetail.applicantName||""),T("emailId",e.applicantDetail.applicantEmailId||""),T("mobileNumber",e.applicantDetail.applicantMobileNo||""))}},[p,T]),n.useEffect(()=>{if(_){const e=setTimeout(()=>A(null),2e3);return()=>clearTimeout(e)}},[_]);const w={marginTop:"-18px",color:"red"},I={color:"red"};return r.createElement("form",{onSubmit:C(function(e){try{var t,n;const r=Date.now(),o=null==p||null===(t=p.ads)||void 0===t?void 0:t.flatMap(e=>e.slots.map(t=>c({},t,{advertisementId:e.ad.id,status:"BOOKED"}))),i={tenantId:y,applicationDate:r,bookingStatus:"BOOKING_CREATED",businessService:"ADV",address:{pincode:(null==e?void 0:e.pincode)||"",addressLine1:(null==e?void 0:e.address)||""},applicantDetail:{applicantName:e.name||"",applicantEmailId:e.emailId||"",applicantMobileNo:e.mobileNumber||"",applicantDetailId:""},owners:[{name:e.name||"",mobileNumber:e.mobileNumber||"",tenantId:y,type:"CITIZEN"}],cartDetails:o,documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}};if(null==p||null===(n=p.CreatedResponse)||void 0===n?void 0:n.bookingNo)return d(i),Promise.resolve();const a=tt(function(){return Promise.resolve(Digit.ADSServices.create({bookingApplication:i},y)).then(function(e){var t;const n=null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status;if("string"==typeof n&&"successful"===n.toLowerCase()){const t=Array.isArray(null==e?void 0:e.bookingApplication)?e.bookingApplication[0]:null==e?void 0:e.bookingApplication;v(Jr("CreatedResponse",t||e)),d(i)}else v(Jr("CreatedResponse",{draft:!0,bookingApplication:i})),A({key:!0,label:u("CORE_SOMETHING_WENT_WRONG")})})},function(){A({key:!0,label:u("CORE_SOMETHING_WENT_WRONG")})});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",{style:{maxWidth:!g&&"500px"}},r.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("ES_NEW_APPLICATION_APPLICANT_NAME")," ",r.createElement("span",{style:I},"*")," "),r.createElement(a.Controller,{control:D,name:"name",rules:{required:u("Applicant Name is Required"),pattern:{value:/^[A-Za-z]+(?:[ '-][A-Za-z]+)*\s*$/,message:u("Applicant Name is Invalid")},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:e=>{i(e),N("name")},t:u})}}),(null==x?void 0:x.name)&&r.createElement(t.CardLabelError,{style:w},null==x||null===(o=x.name)||void 0===o?void 0:o.message),r.createElement(t.CardLabel,null,u("NOC_APPLICANT_EMAIL_LABEL"),r.createElement("span",{style:I},"*")),r.createElement(a.Controller,{control:D,name:"emailId",rules:{required:u("PTR_EMAIL_REQUIRED"),pattern:{value:/^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/,message:"Enter a valid email"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value),onBlur:i,t:u})}}),x.emailId&&r.createElement(t.CardLabelError,{style:w},x.emailId.message),r.createElement(t.CardLabel,null,u("NOC_APPLICANT_MOBILE_NO_LABEL"),r.createElement("span",{style:I},"*")),r.createElement(a.Controller,{control:D,name:"mobileNumber",rules:{required:u("PTR_MOBILE_REQUIRED"),minLength:{value:10,message:"Enter at least 10 digits"},pattern:{value:/^[6-9]\d{9}$/,message:"Must start with 9, 8, 7, or 6 and be 10 digits long"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.MobileNumber,{value:n,onChange:o,onBlur:i,t:u})}}),x.mobileNumber&&r.createElement(t.CardLabelError,{style:w},x.mobileNumber.message),r.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("PT_COMMON_COL_ADDRESS"),r.createElement("span",{style:I},"*")),r.createElement("div",{className:"field"},r.createElement(a.Controller,{control:D,name:"address",rules:{required:u("NDC_MESSAGE_ADDRESS"),pattern:{value:/^[A-Za-z0-9\s.,'/-]+$/,message:u("PTR_ADDRESS_INVALID")},maxLength:{value:500,message:"Maximum 500 characters"},minLength:{value:5,message:"Minimum 5 characters"}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextArea,{value:n,onChange:e=>o(e.target.value),onBlur:e=>{i(e),N("address")},t:u})}})),(null==x?void 0:x.address)&&r.createElement(t.CardLabelError,{style:w},null==x||null===(i=x.address)||void 0===i?void 0:i.message),r.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("CORE_COMMON_PINCODE"),r.createElement("span",{style:I},"*")),r.createElement("div",{className:"field"},r.createElement(a.Controller,{control:D,name:"pincode",rules:{required:u("PTR_PINCODE_REQUIRED"),pattern:{value:/^[1-9][0-9]{5}$/,message:u("PTR_PINCODE_INVALID")},minLength:{value:6,message:u("PTR_PINCODE_MIN_LENGTH")},maxLength:{value:6,message:u("PTR_PINCODE_MAX_LENGTH")}},render:e=>{let{value:n,onChange:o,onBlur:i}=e;return r.createElement(t.TextInput,{value:n,onChange:e=>o(e.target.value.replace(/\D/g,"")),onBlur:e=>{i(e),N("pincode")},t:u,maxLength:6})}})),x.pincode&&r.createElement(t.CardLabelError,{style:w},null==x||null===(l=x.pincode)||void 0===l?void 0:l.message)),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:f}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})),_&&r.createElement(t.Toast,{error:_.key,label:u(_.label),onClose:()=>{A(null)},isDleteBtn:!0}))},ro=e=>{var o;let{ad:i,tenantId:a,onClose:l,onSelectSlot:s,dateRange:u,t:d,cartSlots:p,onRemoveSlot:f}=e;const[m,v]=n.useState([]),[h,g]=n.useState(!1),y=n.useMemo(()=>({advertisementSlotSearchCriteria:[{advertisementId:null==i?void 0:i.id,bookingId:"",addType:null==i?void 0:i.adType,bookingStartDate:null==u?void 0:u.startDate,bookingEndDate:null==u?void 0:u.endDate,faceArea:(null==i?void 0:i.adType)+"_"+(null==i?void 0:i.width)+"_X_"+(null==i?void 0:i.height),tenantId:a,location:null==i?void 0:i.locationCode,nightLight:"With Light"===(null==i?void 0:i.light)?"true":"false",isTimerRequired:!1,amount:null==i?void 0:i.amount}]}),[i,a,u]),{data:E={},isLoading:S}=Digit.Hooks.ads.useADSSlotSearch({tenantId:a,type:!0,data:y}),b=(null==E?void 0:E.advertisementSlotAvailabiltityDetails)||[],_=(null==p||null===(o=p.find(e=>{var t,n,r;return(null==e||null===(t=e.ad)||void 0===t?void 0:t.id)===(null==i?void 0:i.id)&&(null==e||null===(n=e.ad)||void 0===n?void 0:n.bookingStartDate)===(null==u?void 0:u.startDate)&&(null==e||null===(r=e.ad)||void 0===r?void 0:r.bookingEndDate)===(null==u?void 0:u.endDate)}))||void 0===o?void 0:o.slots)||[],A=(null==b?void 0:b.length)>0&&(null==b?void 0:b.every(e=>"AVAILABLE"!==(null==e?void 0:e.slotStaus))),D=null==b?void 0:b.filter(e=>"AVAILABLE"===(null==e?void 0:e.slotStaus)),C=(null==D?void 0:D.length)>0&&(null==D?void 0:D.every(e=>null==_?void 0:_.some(t=>(null==t?void 0:t.bookingDate)===(null==e?void 0:e.bookingDate))));n.useEffect(()=>{C&&g(!0)},[C]);const T=!function(e,t){var n,r,o,i;if(void 0===e&&(e=[]),void 0===t&&(t=[]),(null===(n=e)||void 0===n?void 0:n.length)!==(null===(r=t)||void 0===r?void 0:r.length))return!1;const a=e=>null==e?void 0:e.bookingDate,l=null===(o=e)||void 0===o?void 0:o.map(a).sort(),s=null===(i=t)||void 0===i?void 0:i.map(a).sort();return(null===JSON||void 0===JSON?void 0:JSON.stringify(l))===(null===JSON||void 0===JSON?void 0:JSON.stringify(s))}(m,_);n.useEffect(()=>{null!=i&&i.id&&(null==_?void 0:_.length)>0?(g(!0),v(_)):(g(!1),v([]))},[i,u]);const x=[{Header:()=>r.createElement("input",{type:"checkbox",checked:h,disabled:A,onChange:e=>(e=>{if(g(e),e){const e=null==b?void 0:b.filter(e=>"AVAILABLE"===(null==e?void 0:e.slotStaus));v(e)}else v([])})(e.target.checked),style:{cursor:A?"not-allowed":"pointer",width:"18px",height:"18px",accentColor:"#0b74de"}}),accessor:"select",Cell:e=>{let{row:t}=e;const n=null==t?void 0:t.original;return r.createElement("input",{type:"checkbox",checked:h&&"AVAILABLE"===(null==n?void 0:n.slotStaus),disabled:!0,style:{cursor:"not-allowed",width:"18px",height:"18px",accentColor:"#0b74de"}})}},{Header:d("ADS_DATE"),accessor:"bookingDate"},{Header:d("ADS_LOCATION"),accessor:"location",Cell:e=>{let{value:t}=e;return d(t||"N/A")}},{Header:d("ADS_FACE_AREA"),accessor:"faceArea",Cell:e=>{let{value:t}=e;return d((null==t?void 0:t.replaceAll("_"," "))||"N/A")}},{Header:d("ADS_TYPE"),accessor:"addType"},{Header:d("ADS_NIGHT_LIGHT"),accessor:e=>d(e.nightLight?"ADS_YES":"ADS_NO")},{Header:d("ADS_STATUS"),accessor:"slotStaus",Cell:e=>{var t;let{row:n}=e;const o=null==n||null===(t=n.original)||void 0===t?void 0:t.slotStaus,i="AVAILABLE"===o;return r.createElement("span",{style:{display:"inline-block",padding:"5px 14px",borderRadius:"20px",fontSize:"12px",fontWeight:600,color:i?"#155724":"#721c24",backgroundColor:i?"#d4edda":"#f8d7da",border:"1px solid "+(i?"#c3e6cb":"#f5c6cb"),textTransform:"capitalize"}},o)}}];return r.createElement("div",{style:{position:"fixed",top:"70px",left:0,width:"100vw",height:"calc(100vh - 70px)",background:"rgba(0,0,0,0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e3}},r.createElement("div",{style:{width:"90%",maxWidth:"1100px",height:"70vh",background:"#fff",borderRadius:"12px",padding:"20px",display:"flex",flexDirection:"column",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",borderBottom:"1px solid #eee",paddingBottom:"8px"}},r.createElement("h2",{style:{margin:0,fontSize:"20px",fontWeight:700,color:"#333"}},d("ADS_AVAILIBILITY_FOR")," ",null==i?void 0:i.name," ",A&&r.createElement("span",{style:{color:"#c62828",fontSize:"14px",marginLeft:"8px"}},d("ADS_ALL_SLOTS_BOOKED"))),r.createElement("button",{onClick:l,style:{border:"none",background:"transparent",fontSize:"22px",cursor:"pointer",color:"#666"}},"✖")),r.createElement("div",{style:{flex:1,overflowY:"auto",border:"1px solid #ddd",borderRadius:"8px"}},S?r.createElement("div",{style:{fontSize:"24px",color:"#555",textAlign:"center"}},d("ADS_LOADING_SLOTS")):0===(null==b?void 0:b.length)?r.createElement("div",{style:{fontSize:"24px",color:"#555",textAlign:"center"}},d("ADS_NO_SLOTS_AVAILABLE")):r.createElement(t.Table,{t:d,data:b,columns:x,disableSort:!0,isPaginationRequired:!1,getCellProps:e=>({style:{padding:"12px 14px",fontSize:"14px",borderBottom:"1px solid #f0f0f0",textAlign:"left",backgroundColor:e.row.index%2==0?"#fafafa":"#fff"}})})),r.createElement("div",{style:{marginTop:"12px",display:"flex",justifyContent:"flex-end",gap:"10px"}},r.createElement("button",{onClick:l,style:{padding:"10px 18px",borderRadius:"6px",border:"1px solid #ccc",background:"#f5f5f5",cursor:"pointer"}},d?d("Cancel"):"Cancel"),r.createElement("button",{onClick:()=>{(null==m?void 0:m.length)>0?s(m,c({},i,{faceArea:(null==i?void 0:i.adType)+"_"+(null==i?void 0:i.width)+"_X_"+(null==i?void 0:i.height),location:null==i?void 0:i.name,addType:null==i?void 0:i.adType,amount:null==i?void 0:i.amount,bookingDate:null==u?void 0:u.startDate,nightLight:"With Light"===(null==i?void 0:i.light),bookingStartDate:null==u?void 0:u.startDate,bookingEndDate:null==u?void 0:u.endDate}),u):(null==_?void 0:_.length)>0&&f(i,u),v([]),g(!1),l()},disabled:!T,style:{padding:"10px 18px",borderRadius:"6px",border:"none",background:T?"#2947a3":"#ccc",color:"#fff",fontWeight:600,cursor:T?"pointer":"not-allowed",transition:"background 0.2s"}},"🛒 ",d((null==_?void 0:_.length)>0?"COMMON_REMOVE_LABEL":"ADS_ADD_TO_CART")))))},oo=e=>{let{cartSlots:o,onClose:i,onRemoveSlot:a,t:l}=e;const s=e=>(null==e?void 0:e.id)+"_"+(null==e?void 0:e.bookingStartDate)+"_"+(null==e?void 0:e.bookingEndDate),[u,c]=n.useState(()=>null==o?void 0:o.map(e=>s(e.ad)));return r.createElement("div",{style:{position:"fixed",top:"70px",left:0,width:"100vw",height:"calc(100vh - 70px)",background:"rgba(0,0,0,0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:2e3}},r.createElement("div",{style:{width:"90%",maxWidth:"1100px",height:"70vh",background:"#fff",borderRadius:"12px",padding:"20px",display:"flex",flexDirection:"column",boxShadow:"0 8px 24px rgba(0,0,0,0.25)"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",borderBottom:"1px solid #eee",paddingBottom:"8px"}},r.createElement("h2",{style:{margin:0,fontSize:"20px",fontWeight:700,color:"#333"}},l("ADS_YOUR_CART")),r.createElement("button",{onClick:i,style:{border:"none",background:"transparent",fontSize:"22px",cursor:"pointer",color:"#666"}},"✖")),r.createElement("div",{style:{flex:1,overflowY:"auto"}},0===(null==o?void 0:o.length)?r.createElement("p",{style:{padding:"12px",color:"#666"}},l("ADS_NO_ITEMS_IN_CART")):null==o?void 0:o.map((e,n)=>{var o,i,d,p;const f=s(null==e?void 0:e.ad),m=null==u?void 0:u.includes(f);return r.createElement("div",{key:f,style:{marginBottom:"16px",border:"1px solid #ddd",borderRadius:"8px",overflow:"hidden"}},r.createElement("div",{style:{background:"#f9f9f9",padding:"10px 14px",fontWeight:600,fontSize:"14px",borderBottom:"1px solid #ddd",display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement("div",{onClick:()=>(e=>{c(t=>null!=t&&t.includes(e)?null==t?void 0:t.filter(t=>t!==e):[...t,e])})(f),style:{cursor:"pointer",flex:1}},null==e||null===(o=e.ad)||void 0===o?void 0:o.name,null!=e&&null!==(i=e.ad)&&void 0!==i&&i.amount?" — ₹"+(1.18*(null==e||null===(d=e.ad)||void 0===d?void 0:d.amount)*(null==e||null===(p=e.slots)||void 0===p?void 0:p.length)).toFixed(2):"",r.createElement("span",{style:{fontSize:"18px",marginLeft:"8px"}},m?"▾":"▸")),r.createElement("button",{onClick:()=>{var t,n;return a(null==e?void 0:e.ad,{startDate:null==e||null===(t=e.ad)||void 0===t?void 0:t.bookingStartDate,endDate:null==e||null===(n=e.ad)||void 0===n?void 0:n.bookingEndDate})},style:{padding:"6px 12px",borderRadius:"6px",border:"none",background:"#dc3545",color:"#fff",cursor:"pointer",fontSize:"12px",marginLeft:"10px"}},l("ADS_REMOVE"))),m&&r.createElement("div",{style:{overflowX:"auto"}},r.createElement(t.Table,{t:l,data:null==e?void 0:e.slots,columns:[{Header:l("ADS_DATE"),accessor:"bookingDate"},{Header:l("ADS_LOCATION"),accessor:"location",Cell:e=>{let{value:t}=e;return l(t||"N/A")}},{Header:l("ADS_FACE_AREA"),accessor:"faceArea",Cell:e=>{let{value:t}=e;return l((null==t?void 0:t.replaceAll("_"," "))||"N/A")}},{Header:l("ADS_TYPE"),accessor:"addType"},{Header:l("ADS_NIGHT_LIGHT"),accessor:e=>l(null!=e&&e.nightLight?"ADS_YES":"ADS_NO")},{Header:l("ADS_STATUS"),accessor:"slotStaus",Cell:e=>{var t;let{row:n}=e;const o=null==n||null===(t=n.original)||void 0===t?void 0:t.slotStaus,i="AVAILABLE"===o;return r.createElement("span",{style:{display:"inline-block",padding:"5px 14px",borderRadius:"20px",fontSize:"12px",fontWeight:600,color:i?"#155724":"#721c24",backgroundColor:i?"#d4edda":"#f8d7da",border:"1px solid "+(i?"#c3e6cb":"#f5c6cb"),textTransform:"capitalize"}},o)}}],disableSort:!0,isPaginationRequired:!1,getCellProps:e=>({style:{padding:"12px 14px",fontSize:"14px",borderBottom:"1px solid #f0f0f0",textAlign:"left",whiteSpace:"nowrap"}})})))}))))},io=e=>{let{ad:t,idx:n,control:o,watch:i,t:l,onViewAvailability:s=(()=>{}),cartSlots:u=[],openCart:c,scheduleType:d}=e;const p=i("ads."+n+".startDate")||"",f=function(e){const t=new Date,n=t.getFullYear(),r=t.getMonth();return"Monthly"===e||"Weekly"===e||"FortNight"===e?new Date(n,r,1).toISOString().split("T")[0]:"Yearly"===e?r<3?new Date(n-1,3,1).toISOString().split("T")[0]:new Date(n,3,1).toISOString().split("T")[0]:t.toISOString().split("T")[0]}(d),m=null==u?void 0:u.some(e=>{var n,r;return(null==e||null===(n=e.ad)||void 0===n?void 0:n.id)===(null==t?void 0:t.id)&&(null==e||null===(r=e.slots)||void 0===r?void 0:r.length)>0});return r.createElement("div",{style:{width:280,borderRadius:8,padding:9,background:"#fff",boxShadow:"0 4px 10px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",gap:8}},r.createElement("div",{style:{width:"100%",height:120,borderRadius:8,overflow:"hidden",background:"#f5f5f5"}},t.imageSrc||t.photoURL?r.createElement("img",{src:(null==t?void 0:t.imageSrc)||(null==t?void 0:t.photoURL),alt:(null==t?void 0:t.name)||"Ad "+(null==t?void 0:t.id),loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover"}}):r.createElement("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#aaa"}},l("ADS_NO_IMAGE"))),r.createElement("div",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:13,color:"#444"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontWeight:600}},r.createElement("span",null,t.name),r.createElement("span",{style:{color:"#222"}},"₹",null==t?void 0:t.amount)),r.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},r.createElement("span",null,null==t?void 0:t.locationCode),r.createElement("span",null,"Pole ",t.poleNo)),r.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},r.createElement("span",null,null==t?void 0:t.adType),r.createElement("span",{style:{color:"green",fontWeight:600}},null==t?void 0:t.light))),r.createElement("div",{style:{fontSize:12,color:"#666",marginTop:6}},l("ADS_START_DATE_TIME")),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement(a.Controller,{control:o,name:"ads."+n+".startDate",render:e=>r.createElement("input",{type:"date",min:f,value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{flex:1,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})}),r.createElement(a.Controller,{control:o,name:"ads."+n+".startTime",render:e=>r.createElement("input",{type:"time",value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{width:110,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})})),r.createElement("div",{style:{fontSize:12,color:"#666",marginTop:6}},l("ADS_END_DATE_TIME")),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement(a.Controller,{control:o,name:"ads."+n+".endDate",render:e=>r.createElement("input",{type:"date",min:p||f,value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{flex:1,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})}),r.createElement(a.Controller,{control:o,name:"ads."+n+".endTime",render:e=>r.createElement("input",{type:"time",value:e.value||"",onChange:t=>e.onChange(t.target.value),style:{width:110,padding:"6px 8px",fontSize:13,borderRadius:6,border:"1px solid #ccc"}})})),r.createElement("div",{style:{display:"flex",gap:8,marginTop:6}},r.createElement("button",{type:"button",onClick:()=>s(t,{startDate:i("ads."+n+".startDate"),endDate:i("ads."+n+".endDate"),startTime:i("ads."+n+".startTime"),endTime:i("ads."+n+".endTime")}),style:{flex:1,padding:"6px 12px",borderRadius:6,background:"#2947a3",color:"#fff",border:"none",cursor:"pointer",fontSize:14}},l("ADS_VIEW_AVAILABILITY"),"👁️"),m&&r.createElement("button",{type:"button",onClick:c,style:{width:110,padding:"6px 12px",borderRadius:6,background:"#28a745",color:"#fff",fontSize:14,fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},r.createElement("span",{style:{color:"black"}},"🛒"),l("ADS_IN_CART"))))},ao=e=>{var o,i,l;let{goNext:u,currentStepData:d,t:p}=e;const f="undefined"!=typeof window&&(null===(o=window.location)||void 0===o||null===(i=o.href)||void 0===i?void 0:i.includes("citizen")),v=f?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),[h,g]=n.useState([]),[y,E]=n.useState(null),[S,b]=n.useState(6),[_,A]=n.useState(!1),[D,C]=n.useState(!1),[T,x]=n.useState(null),[N,w]=n.useState({startDate:"",endDate:""}),{data:I=[]}=Digit.Hooks.ads.useADSAllMDMS(v),{data:L=[]}=Digit.Hooks.ads.useADSLocationMDMS(v),{data:k=[]}=Digit.Hooks.ads.useADSScheduleTypeMDMS(v),[O,R]=n.useState([]),P=s.useDispatch(),{control:M,handleSubmit:B,setValue:F,watch:j,formState:{errors:H}}=a.useForm({defaultValues:{siteId:null,geoLocation:null,ads:[]}}),U=n.useMemo(()=>{if(!I||!L)return[];const e=new Map;L.forEach(t=>{null!=t&&t.code&&e.set(t.code,t)});const t=new Set(I.map(e=>e.locationCode).filter(Boolean));return Array.from(t).map(t=>e.get(t)).filter(Boolean)},[I,L]);n.useEffect(()=>{b(6)},[h.length]);const z=e=>{var t,n;const r=I.filter(t=>String(t.locationCode)===String(e.code));g(r),F("ads",[]);const o=Array.isArray(L)&&L.find(t=>String(t.code)===String(e.code))||null;null!=o&&null!==(t=o.geo_tag)&&void 0!==t&&t.latitude&&null!=o&&null!==(n=o.geo_tag)&&void 0!==n&&n.longitude&&F("geoLocation",{formattedAddress:o.name||e.code,latitude:o.geo_tag.latitude,longitude:o.geo_tag.longitude,lat:o.geo_tag.latitude,lng:o.geo_tag.longitude,placeId:o.locationCode})};n.useEffect(()=>{const e=h.map(()=>({startDate:"",startTime:"",endDate:"",endTime:""}));F("ads",e,{shouldValidate:!1,shouldDirty:!1})},[h,F]),n.useEffect(()=>{if(y){const e=setTimeout(()=>E(null),2e3);return()=>clearTimeout(e)}},[y]);const W=(e,t)=>{let{startDate:n,endDate:r,startTime:o,endTime:i}=t;const a=(e=>{let{startDate:t,endDate:n,startTime:r,endTime:o,scheduleType:i}=e;if(!(t&&n&&r&&o))return"Start and end date/time are required.";const a=m(new Date(t)),l=m(new Date(n)),s=a.getFullYear(),u=a.getMonth(),c=new Date(s,u+1,0).getDate();switch(i){case"Monthly":{const e=m(new Date(s,u,1)),t=m(new Date(s,u,c));if(t<m(new Date))return"This Monthly block ("+e.toDateString()+" – "+t.toDateString()+") is already in the past. Please select a future month.";if(a.getTime()!==e.getTime()||l.getTime()!==t.getTime())return"For Monthly, you must select "+e.toDateString()+" to "+t.toDateString();break}case"Weekly":{const e=a.getDate();let t,n;e>=1&&e<=7?(t=1,n=7):e>=8&&e<=15?(t=8,n=15):e>=16&&e<=23?(t=16,n=23):(t=24,n=c);const r=m(new Date(s,u,t)),o=m(new Date(s,u,n));if(o<m(new Date))return"This weekly block ("+t+"-"+n+" "+a.toLocaleString("default",{month:"long"})+") is already in the past. Please select a future block.";if(a.getTime()!==r.getTime()||l.getTime()!==o.getTime())return"For Weekly, you must select "+t+"-"+n+" of "+a.toLocaleString("default",{month:"long"});break}case"FortNight":{const e=m(new Date(s,u,1)),t=m(new Date(s,u,15)),n=m(new Date(s,u,16)),r=m(new Date(s,u,c)),o=m(new Date);if(a.getTime()===e.getTime()&&t<o||a.getTime()===n.getTime()&&r<o)return"This FortNight block is already in the past. Please select a future block.";if(!(a.getTime()===e.getTime()&&l.getTime()===t.getTime()||a.getTime()===n.getTime()&&l.getTime()===r.getTime()))return"For FortNight, you must select 1–15 or 16–"+c+" of "+a.toLocaleString("default",{month:"long"});break}case"Yearly":{let e,t;if(u<3?(e=m(new Date(s-1,3,1)),t=m(new Date(s,2,31))):(e=m(new Date(s,3,1)),t=m(new Date(s+1,2,31))),a.getTime()!==e.getTime()||l.getTime()!==t.getTime())return"For Yearly, you must select "+e.toDateString()+" to "+t.toDateString()+" (Financial Year)";break}default:return"Invalid schedule type."}return null})({startDate:n,endDate:r,startTime:o,endTime:i,scheduleType:k});if(a)return void E({label:a,error:!0});const l=L.find(t=>t.code===(null==e?void 0:e.locationCode));x(c({},e,{locationName:l,startDate:n,endDate:r})),w({startDate:n,endDate:r,startTime:o,endTime:i}),A(!0)},q=(e,t)=>{R(n=>n.filter(n=>{var r,o,i;return!((null==n||null===(r=n.ad)||void 0===r?void 0:r.id)===(null==e?void 0:e.id)&&(null==n||null===(o=n.ad)||void 0===o?void 0:o.bookingStartDate)===(null==t?void 0:t.startDate)&&(null==n||null===(i=n.ad)||void 0===i?void 0:i.bookingEndDate)===(null==t?void 0:t.endDate))})),E({label:"Removed slots for "+(null==e?void 0:e.name)+" ("+(null==t?void 0:t.startDate)+" → "+(null==t?void 0:t.endDate)+")",error:!0})};n.useEffect(()=>{var e;if((null==d||null===(e=d.ads)||void 0===e?void 0:e.length)>0){var t,n,r,o;R(d.ads);const e=null===(t=d.ads[0])||void 0===t||null===(n=t.ad)||void 0===n?void 0:n.locationCode,i=null==U?void 0:U.find(t=>t.code===e);i&&(F("siteId",i),z(i)),null!=i&&null!==(r=i.geo_tag)&&void 0!==r&&r.latitude&&null!=i&&null!==(o=i.geo_tag)&&void 0!==o&&o.longitude&&F("geoLocation",{formattedAddress:i.name,latitude:i.geo_tag.latitude,longitude:i.geo_tag.longitude,lat:i.geo_tag.latitude,lng:i.geo_tag.longitude,placeId:i.code})}},[d,U]);const V=function(e,t){switch(e){case"Monthly":return t("ADS_GUIDE_MONTHLY");case"Weekly":return t("ADS_GUIDE_WEEKLY");case"FortNight":return t("ADS_GUIDE_FORTNIGHT");case"Yearly":return t("ADS_GUIDE_YEARLY");default:return""}}(k,p);return r.createElement(r.Fragment,null,(null==O?void 0:O.length)>0&&r.createElement("div",{style:{display:"flex",justifyContent:"end"}},r.createElement("button",{style:{marginLeft:"12px",padding:"8px 16px",background:"#2947a3",color:"#fff",border:"none",borderRadius:"6px",cursor:"pointer"},onClick:()=>C(!0)},r.createElement("span",{style:{marginRight:6}},"🛒"),p("ADS_VIEW_CART")," (",null==O?void 0:O.length,")")),r.createElement("form",{onSubmit:B(function(e){try{var t,n;if(0===(null==O?void 0:O.length))return E({label:p("ADS_ONE_AD_ATLEAST"),error:!0}),Promise.resolve();if((null==d||null===(t=d.ads)||void 0===t?void 0:t.length)>0&&function(e,t){var n,r;if(void 0===e&&(e=[]),void 0===t&&(t=[]),(null===(n=e)||void 0===n?void 0:n.length)!==(null===(r=t)||void 0===r?void 0:r.length))return!1;const o=e=>{var t;return null===(t=[...e])||void 0===t?void 0:t.sort((e,t)=>{var n,r;return String(null==e||null===(n=e.ad)||void 0===n?void 0:n.id).localeCompare(String(null==t||null===(r=t.ad)||void 0===r?void 0:r.id))})},i=o(e),a=o(t);return i.every((e,t)=>{var n,r,o,i,l,s;const u=a[t];if(String(null==e||null===(n=e.ad)||void 0===n?void 0:n.id)!==String(null==u||null===(r=u.ad)||void 0===r?void 0:r.id))return!1;const c=null==e||null===(o=e.slots)||void 0===o||null===(i=o.map(e=>null==e?void 0:e.bookingDate))||void 0===i?void 0:i.sort(),d=null==u||null===(l=u.slots)||void 0===l||null===(s=l.map(e=>null==e?void 0:e.bookingDate))||void 0===s?void 0:s.sort();return(null==c?void 0:c.length)===(null==d?void 0:d.length)&&(null==c?void 0:c.every((e,t)=>e===d[t]))})}(O,null==d?void 0:d.ads))return u(O),Promise.resolve();const e={advertisementSlotSearchCriteria:null!=(n=null==O?void 0:O.flatMap(e=>e.slots.map(e=>c({},e,{isTimerRequired:!0}))))?n:[]},r=tt(function(){return Promise.resolve(Digit.ADSServices.slot_search(e,v)).then(function(e){if(e){const e=Date.now();P(Jr("reservationExpiry",e)),u(O)}else E({label:p("COMMON_SOMETHING_WENT_WRONG_LABEL"),error:!0})})},function(){E({label:p("COMMON_SOMETHING_WENT_WRONG_LABEL"),error:!0})});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement(t.CardLabel,null,p("ADS_SITE_NAME_LABEL")," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement("div",{style:{width:"100%"}},f&&r.createElement("style",null,"\n .form-field {\n width: 100% !important;\n }\n .select-wrap {\n width: 100% !important;\n }\n .select {\n border: 1px solid #b4b4b4 !important;\n border-radius: 8px !important;\n height: 2.9rem !important;\n }\n .select-active {\n border: 1px solid #2947a3 !important;\n border-radius: 8px !important;\n }\n "),r.createElement(a.Controller,{control:M,name:"siteId",rules:{required:p("ADS_SITE_NAME_REQUIRED")},render:e=>r.createElement(t.Dropdown,{className:"form-field",option:U,optionKey:"name",selected:e.value,select:t=>{e.onChange(t),z(t)}})})),H.siteId&&r.createElement(t.CardLabelError,{style:{marginTop:"-18px",color:"red"}},H.siteId.message),V&&(null==h?void 0:h.length)>0&&r.createElement("div",{style:{background:"#fff3cd",border:"1px solid #ffeeba",color:"#856404",padding:"6px 10px",borderRadius:"6px",fontSize:"14px",marginBottom:"8px",width:"100%",maxWidth:"545px"}},"⚠️ ",V),(null==h?void 0:h.length)>0&&r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:12}},null==h||null===(l=h.slice(0,S))||void 0===l?void 0:l.map((e,t)=>r.createElement(io,{key:e.id||t,ad:e,idx:t,control:M,watch:j,cartSlots:O,onViewAvailability:W,openCart:()=>C(!0),t:p,scheduleType:k}))),(null==h?void 0:h.length)>6&&r.createElement("div",{style:{textAlign:"center",marginTop:"1rem"}},S<h.length?r.createElement("button",{type:"button",style:{padding:"8px 12px",borderRadius:6,border:"1px solid #ccc",background:"#fff",cursor:"pointer"},onClick:()=>b(e=>e+6)},p("ADS_SHOW_MORE")):r.createElement("button",{type:"button",style:{padding:"8px 12px",borderRadius:6,border:"1px solid #ccc",background:"#fff",cursor:"pointer"},onClick:()=>b(6)},p("SHOW_LESS"))),r.createElement(t.CardLabel,null,p("CS_COMPLAINT_DETAILS_GEO_LOCATION")),r.createElement(a.Controller,{control:M,name:"geoLocation",render:e=>r.createElement(lt,{value:e.value,onChange:e.onChange,t:p})}),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})),_&&r.createElement(ro,{ad:T,tenantId:v,onClose:()=>A(!1),onSelectSlot:(e,t,n)=>{R(r=>{const o=null==e?void 0:e.map(e=>c({},e,{bookingStartDate:null==e?void 0:e.bookingDate,bookingEndDate:null==n?void 0:n.endDate,bookingFromTime:null==n?void 0:n.startTime,bookingToTime:null==n?void 0:n.endTime}));let i;return r.find(e=>{var r,o,i;return(null==e||null===(r=e.ad)||void 0===r?void 0:r.id)===(null==t?void 0:t.id)&&(null==e||null===(o=e.ad)||void 0===o?void 0:o.bookingStartDate)===(null==n?void 0:n.startDate)&&(null==e||null===(i=e.ad)||void 0===i?void 0:i.bookingEndDate)===(null==n?void 0:n.endDate)})?(i=r.map(e=>{var r,i,a;return(null==e||null===(r=e.ad)||void 0===r?void 0:r.id)===(null==t?void 0:t.id)&&(null==e||null===(i=e.ad)||void 0===i?void 0:i.bookingStartDate)===(null==n?void 0:n.startDate)&&(null==e||null===(a=e.ad)||void 0===a?void 0:a.bookingEndDate)===(null==n?void 0:n.endDate)?c({},e,{slots:o}):e}),E({label:"Updated "+o.length+" slot(s) for "+(null==t?void 0:t.name)+" ("+(null==n?void 0:n.startDate)+" → "+(null==n?void 0:n.endDate)+")",error:!1})):(i=[...r,{ad:c({},t,{bookingStartDate:null==n?void 0:n.startDate,bookingEndDate:null==n?void 0:n.endDate}),slots:o}],E({label:"Added "+(null==o?void 0:o.length)+" slot(s) to "+(null==t?void 0:t.name)+" ("+(null==n?void 0:n.startDate)+" → "+(null==n?void 0:n.endDate)+")",error:!1})),i})},cartSlots:O,t:p,dateRange:N,onRemoveSlot:q}),D&&r.createElement(oo,{cartSlots:O,onClose:()=>C(!1),onRemoveSlot:q,t:p}),y&&r.createElement(t.Toast,{error:y.error,label:p?p(y.label):y.label,onClose:()=>E(null),isDleteBtn:!0})))},lo=e=>{let{t:o,goNext:i,currentStepData:l,onGoBack:s}=e;const{control:u,handleSubmit:c,setValue:d,watch:p,formState:{errors:f}}=a.useForm({defaultValues:{penalty:"No",penaltyAmount:"",referenceId:""}}),m=p("penalty");return n.useEffect(()=>{l&&Object.entries(l).forEach(e=>{let[t,n]=e;d(t,null!=n?n:"")})},[l,d]),r.createElement("form",{onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),i(e)})},r.createElement(t.CardLabel,null,o("Penalty")),r.createElement(a.Controller,{name:"penalty",control:u,render:e=>r.createElement("div",{style:{display:"flex",gap:"20px"}},r.createElement("label",null,r.createElement("input",{type:"radio",value:"Yes",checked:"Yes"===e.value,onChange:()=>e.onChange("Yes")})," ","Yes"),r.createElement("label",null,r.createElement("input",{type:"radio",value:"No",checked:"No"===e.value,onChange:()=>e.onChange("No")})," ","No"))}),r.createElement(t.CardLabel,null,o("Penalty Amount")),r.createElement(a.Controller,{name:"penaltyAmount",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.penaltyAmount&&r.createElement("p",{style:{color:"red"}},f.penaltyAmount.message),r.createElement(t.CardLabel,null,o("Reference ID")),r.createElement(a.Controller,{name:"referenceId",control:u,rules:{validate:e=>"No"===m||!!e||o("This field is required")},render:e=>{var n;return r.createElement(t.TextInput,{value:null!=(n=e.value)?n:"",onChange:t=>e.onChange(t.target.value),disabled:"Yes"!==m,t:o})}}),f.referenceId&&r.createElement("p",{style:{color:"red"}},f.referenceId.message),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{style:{background:"white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:c(e=>{"No"===e.penalty&&(e.penaltyAmount="",e.referenceId=""),s(e)})}),r.createElement(t.SubmitBar,{label:"Next",submit:"submit"})))},so=[{head:"ES_TITILE_PET_DETAILS",stepNumber:1,body:[{route:"pet-details",component:"ADSSiteMaster",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInCitizen:!0,nextStep:"null"}]}],uo=(window.location.href.includes("employee"),[{head:"PET DETAILS",stepLabel:"SITE_MASTER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteMasterFormStepOne",key:"pets",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]),co=[{i18nKey:"ADS_AVAILABLE",code:"AVAILABLE",name:"Available"},{i18nKey:"ADS_UNAVAILABLE",code:"UNAVAILABLE",name:"Unavailable"}],po=e=>{let{goNext:o,currentStepData:i,t:l}=e;const u=Digit.ULBService.getStateId(),{data:d=[]}=Digit.Hooks.ads.useADSAllMDMS(u),p=new Date;p.setMinutes(p.getMinutes()-p.getTimezoneOffset());const f=p.toISOString().slice(11,16),m=window.location.href.includes("citizen"),v={siteId:"",siteName:"",geoLocation:null,cartAddress:"",size:"",advertisementType:"",availabilityStatus:"",gstApplicable:!1,cowCessApplicable:!1,rate:""},{control:h,handleSubmit:g,setValue:y,watch:E,reset:S,formState:{errors:b}}=a.useForm({defaultValues:v}),_=(new Date).getTime(),A=e=>{var t;const n=x[e];n&&(S(c({},v,n,{bookingFromTime:n.bookingFromTime||f,bookingToTime:n.bookingToTime||f})),I(e),T((null===(t=n.geoLocation)||void 0===t?void 0:t.formattedAddress)||""))},D=s.useDispatch(),[C,T]=n.useState(""),[x,N]=n.useState([]),[w,I]=n.useState(null),L=g(e=>{null!==w&&w>=0?(N(t=>t.map((t,n)=>n===w?e:t)),I(null)):N(t=>[...t,e]),S(c({},v,{bookingFromTime:f,bookingToTime:f})),T("")});return n.useEffect(()=>{const e=(null==i?void 0:i.siteDetails)||i;e&&(Object.entries(e).forEach(e=>{let[t,n]=e;y(t,n)}),e.bookingFromTime||y("bookingFromTime",f),e.bookingToTime||y("bookingToTime",f))},[i,y]),n.useEffect(()=>{var e;const t=E("siteName");!t||!t.geo_tag||E("geoLocation")&&null!==(e=E("geoLocation"))&&void 0!==e&&e.latitude||(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!1}),T(t.name))},[E("siteName")]),r.createElement(r.Fragment,null,x.length>0&&r.createElement("div",{style:{margin:"12px 0",padding:8,border:"1px dashed #ddd",borderRadius:6}},r.createElement("div",{style:{fontWeight:600,marginBottom:8}},l?l("Added Advertisements"):"Added Advertisements"),x.map((e,t)=>{var n,o,i;return r.createElement("div",{key:t,style:{display:"flex",justifyContent:"space-between",gap:8,alignItems:"center",padding:"6px 0",borderBottom:t<x.length-1?"1px solid #eee":"none",cursor:"pointer",background:w===t?"#fafafa":"transparent",paddingRight:12}},r.createElement("div",{onClick:()=>A(t),style:{flex:1}},r.createElement("div",{style:{fontSize:13,fontWeight:500}},(null===(n=e.siteName)||void 0===n?void 0:n.name)||e.siteId||"Ad "+(t+1)),r.createElement("div",{style:{fontSize:12,color:"#666"}},e.cartAddress||(null===(o=e.geoLocation)||void 0===o?void 0:o.formattedAddress)||(null!==(i=e.geoLocation)&&void 0!==i&&i.latitude?e.geoLocation.latitude+", "+e.geoLocation.longitude:""))),r.createElement("div",{style:{display:"flex",gap:8}},r.createElement("button",{type:"button",onClick:()=>A(t),style:{background:"#fff",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Edit"):"Edit"),r.createElement("button",{type:"button",onClick:()=>{return e=t,N(t=>t.filter((t,n)=>n!==e)),void(w===e?(I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),T("")):null!==w&&w>e&&I(e=>null!==e?e-1:null));var e},style:{background:"transparent",border:"1px solid #ccc",padding:"6px 8px",borderRadius:4,cursor:"pointer"}},l?l("Remove"):"Remove")))})),r.createElement("form",{onSubmit:g(function(e){try{var t,n,r,a,l,s,u,d,p,h,g;const y=m?"pb.amritsar":"pb.testing",E=(null==i||null===(t=i.ownerDetails)||void 0===t?void 0:t.address)||{},b=[...x,e],A={addressLine1:E.addressline1||E.addressLine1||"",city:(null===(n=E.city)||void 0===n?void 0:n.name)||E.city||"",cityCode:E.cityCode||(null===(r=E.city)||void 0===r?void 0:r.code)||"",houseNo:E.houseNo||"",landmark:E.landmark||"",locality:(null===(a=E.locality)||void 0===a?void 0:a.code)||E.locality||"",localityCode:E.localityCode||(null===(l=E.locality)||void 0===l?void 0:l.code)||"",pincode:E.pincode||"",streetName:E.streetName||""},C={tenantId:y,applicationDate:_,bookingStatus:"BOOKING_CREATED",address:A,applicantDetail:{applicantName:((null==i||null===(s=i.ownerDetails)||void 0===s?void 0:s.firstName)||"")+" "+((null==i||null===(u=i.ownerDetails)||void 0===u?void 0:u.lastName)||""),applicantEmailId:(null==i||null===(d=i.ownerDetails)||void 0===d?void 0:d.emailId)||"",applicantMobileNo:(null==i||null===(p=i.ownerDetails)||void 0===p?void 0:p.mobileNumber)||"",selfDeclaration:(null==i||null===(h=i.ownerDetails)||void 0===h?void 0:h.selfDeclaration)||!0,applicantDetailId:"",SGST:(null==i||null===(g=i.ownerDetails)||void 0===g?void 0:g.SGST)||""}||{},additional_details:"geolocation , siteName, SGST, selfDeclaration , endDate ,",cartDetails:b.map(e=>{var t,n,r,o,i;return{addType:(null===(t=e.advertisementType)||void 0===t?void 0:t.code)||e.advertisementType,bookingDate:e.startDate,endDate:e.endDate,bookingFromTime:e.bookingFromTime,bookingToTime:e.bookingToTime,advertisementId:e.siteId||"",cartId:e.siteId||"",cartAddress:e.cartAddress||"",geoLocation:(null===(n=e.geoLocation)||void 0===n?void 0:n.code)||e.geoLocation,faceArea:(null===(r=e.size)||void 0===r?void 0:r.code)||e.size,location:(null===(o=e.siteName)||void 0===o?void 0:o.code)||e.siteName||"",status:"BOOKING_CREATED",availabilityStatus:(null===(i=e.availabilityStatus)||void 0===i?void 0:i.code)||e.availabilityStatus||"",rate:e.rate||""}}),documents:[],workflow:{action:"INITIATE",comments:"Initial application submitted",status:"INITIATED",nextState:""}};D(Jr("applicantDetail",C.applicantDetail)),D(Jr("cartDetails",C.cartDetails)),D(Jr("cartAddress",e.cartAddress)),D(Jr("siteDetails",e)),D(Jr("siteId",e.siteId)),D(Jr("siteName",e.siteName)),D(Jr("bookingFromTime",e.bookingFromTime)),D(Jr("bookingToTime",e.bookingToTime));const T={draft:!0,bookingApplication:C},w=tt(function(){return Promise.resolve(Digit.ADSServices.create({bookingApplication:C},y)).then(function(e){var t;const n=null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status;if("string"==typeof n&&"successful"===n.toLowerCase()){const t=Array.isArray(null==e?void 0:e.bookingApplication)?e.bookingApplication[0]:null==e?void 0:e.bookingApplication;D(Jr("CreatedResponse",t||e)),N([]),I(null),S(c({},v,{bookingFromTime:f,bookingToTime:f})),o(e)}else console.error("ADS create failed:",e),D(Jr("CreatedResponse",{draft:!0,bookingApplication:C})),o(c({},T,{draft:!0}))})},function(e){console.error("ADS create error:",e),D(Jr("CreatedResponse",{draft:!0,bookingApplication:C})),o(c({},T,{draft:!0}))});return Promise.resolve(w&&w.then?w.then(function(){}):void 0)}catch(e){return Promise.reject(e)}})},r.createElement("div",null,r.createElement(t.CardLabel,null,"Enter site id ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"siteId",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteId&&r.createElement("p",{style:{color:"red"}},b.siteId.message),r.createElement(t.CardLabel,null,"Site Name ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"siteName",rules:{required:"This field is required",pattern:{value:/^[a-zA-Z0-9]+$/,message:"Only letters and numbers allowed"},maxLength:{value:100,message:"Maximum 100 characters"},minLength:{value:2,message:"Minimum 2 characters"}},render:e=>r.createElement(t.TextInput,{className:"form-field",select:t=>{e.onChange(t),t&&t.geo_tag&&t.geo_tag.latitude&&t.geo_tag.longitude&&(y("geoLocation",{formattedAddress:t.name,latitude:t.geo_tag.latitude,longitude:t.geo_tag.longitude,lat:t.geo_tag.latitude,lng:t.geo_tag.longitude,placeId:t.code,raw:t},{shouldValidate:!0,shouldDirty:!0}),T(t.name),E("cartAddress")||y("cartAddress",t.name))},onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.siteName&&r.createElement("p",{style:{color:"red"}},b.siteName.message),r.createElement(t.CardLabel,null,"Geo Location ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"geoLocation",rules:{required:"This field is required",validate:e=>e&&(e.latitude||e.lat)&&(e.longitude||e.lng)||"Please pick a location"},render:e=>r.createElement(lt,{value:e.value,onChange:t=>{e.onChange(t),T((null==t?void 0:t.formattedAddress)||"")},onBlur:e.onBlur,t:l})}),b.geoLocation&&r.createElement("p",{style:{color:"red"}},b.geoLocation.message),r.createElement(t.CardLabel,null,"Address ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"cartAddress",rules:{required:"This field is required",pattern:{value:/^(?=.*[a-zA-Z]).*$/,message:"Enter valid address , atleast one letter must be present"},maxLength:{value:500,message:"Maximum 500 characters"},minLength:{value:5,message:"Minimum 5 characters"}},render:e=>r.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),b.cartAddress&&r.createElement("p",{style:{color:"red"}},b.cartAddress.message),r.createElement(t.CardLabel,null,"Size ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"height",rules:{required:"Height is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"height"})}}),b.height&&r.createElement("p",{style:{color:"red"}},b.height.message),r.createElement(a.Controller,{control:h,name:"width",rules:{required:"Width is required"},render:e=>{let{field:n}=e;return r.createElement(t.Dropdown,{className:"form-field",select:n.onChange,selected:n.value,option:d,optionKey:"width"})}}),b.width&&r.createElement("p",{style:{color:"red"}},b.width.message),r.createElement(t.CardLabel,null,"Advertisement Type ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"advertisementType",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:d,optionKey:"adType"})}),b.advertisementType&&r.createElement("p",{style:{color:"red"}},b.advertisementType.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Rate / Price of the site (₹) ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"rate",rules:{pattern:{value:/^(?!.*[eE])[0-9]+(\.[0-9]{1,2})?$/,message:"Enter a valid amount"},maxLength:{value:12,message:"Maximum 12 characters"},required:"This field is required"},render:e=>r.createElement(t.TextInput,{type:"number",step:"0.01",min:"0",value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t)})}),b.rate&&r.createElement("p",{style:{color:"red"}},b.rate.message),r.createElement(t.CardLabel,null,"Availability Status ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"availabilityStatus",rules:{required:"This field is required"},render:e=>r.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:co,optionKey:"i18nKey"})}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.availabilityStatus.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"GST Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"gstApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"gstApplicable"}),r.createElement("label",{htmlFor:"gstApplicable",style:{marginLeft:8}},"Yes"))}),b.availabilityStatus&&r.createElement("p",{style:{color:"red"}},b.gstApplicable.message),r.createElement(t.CardLabel,{style:{marginTop:"12px"}},"Cow Cess Applicable ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(a.Controller,{control:h,name:"cowCessApplicable",rules:{required:"This field is required"},render:e=>r.createElement("div",null,r.createElement("input",{type:"checkbox",checked:!!e.value,onChange:t=>e.onChange(t.target.checked),id:"cowCessApplicable"}),r.createElement("label",{htmlFor:"cowCessApplicable",style:{marginLeft:8}},"Yes"))}),b.cowCessApplicable&&r.createElement("p",{style:{color:"red"}},b.cowCessApplicable.message)),r.createElement("div",{style:{margin:"12px 0"}},r.createElement("button",{type:"button",onClick:L,style:{background:"#f1f1f1",border:"1px solid #ccc",padding:"8px 12px",borderRadius:4,cursor:"pointer"}},null!==w?l?l("Save Site"):"Save Site":l?l("Add Site"):"Add Site")),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))},fo=[{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:1,body:[{route:"documents",component:"ADSSiteInspection",withoutLabel:!0,key:"documents",type:"component",nextStep:"null"}]}],mo=(window.location.href.includes("employee"),[{head:"ES_TITILE_DOCUMENT_DETAILS",stepLabel:"ES_TITILE_SITE_INSPECTION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewSiteInspectionStepperFormOne",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]);function vo(e){var o;let{t:i,document:a,setDocuments:l,setError:s,documents:u,action:d,formData:p,handleSubmit:f,id:m}=e;const v=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[h,g]=(Digit.ULBService.getCurrentTenantId(),n.useState(v?c({},v,{active:!0===(null==a?void 0:a.active),code:null==v?void 0:v.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[y,E]=n.useState(null),[S,b]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[_,A]=n.useState(()=>(null==v?void 0:v.fileName)||null),{dropdownData:D}=a;var C=D;const[T,x]=n.useState(!1);T&&A(null);const[N,w]=n.useState(!1),I=["image/jpeg","image/png","application/pdf"],L=[".jpeg",".jpg",".png",".pdf"];return n.useEffect(()=>{null!=h&&h.code&&l(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==S?void 0:S.length)||null===S?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==S))||[],{documentType:null==h?void 0:h.code,fileStoreId:S,documentDetailId:S,fileName:_||(null==v?void 0:v.fileName)||null,mimeType:(null==y?void 0:y.type)||null,size:(null==y?void 0:y.size)||null}]})},[S,_,h]),n.useEffect(()=>{(null==u?void 0:u.length)>0&&f()},[u]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],r=null==C?void 0:C.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];r?(g(r),b(null==n?void 0:n.fileStoreId),A((null==n?void 0:n.fileName)||null)):x(!0)}},[]),n.useEffect(()=>{var e;null!=a&&a.hasDropdown||g({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{s(null),function(){if(y){if(w(!0),!(y.type&&I.includes(y.type)||L.some(e=>{var t;return null===(t=y.name)||void 0===t?void 0:t.toLowerCase().endsWith(e)})))return w(!1),b(null),void s(i("CS_FILE_TYPE_NOT_ALLOWED")||"Only PDF, JPG, JPEG, and PNG files are allowed.");if(y.size>=5242880)return w(!1),b(null),void s(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));const e=tt(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,Digit.ULBService.getStateId())).then(function(e){var t,n,r,o;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?b(null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId):s(i("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),s(i("CS_FILE_UPLOAD_ERROR"))});e&&e.then&&e.then(function(){})}}()}catch(e){Promise.reject(e)}}()},[y]),n.useEffect(()=>{T&&b(null)},[T]),r.createElement("div",{style:{marginBottom:"24px"}},N&&r.createElement(t.Loader,null),(null==a?void 0:a.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *")),r.createElement(t.Dropdown,{className:"form-field",selected:h,style:{width:"100%"},option:C.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>g(e),optionKey:"i18nKey",t:i})),!(null!=a&&a.hasDropdown)&&r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"},i(null==a?void 0:a.code.replaceAll(".","_")),r.createElement("span",{style:{color:"red"}}," *"))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller"}),r.createElement("div",{className:"field"},r.createElement(t.UploadFile,{onUpload:function(e){var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];E(n),A((null==n?void 0:n.name)||null)},onDelete:()=>{b(null),A(null),s&&s(null)},id:m,message:S?""+(_||(null==v?void 0:v.fileName)||"1 "+i("CS_ACTION_FILEUPLOADED")):i("CS_ACTION_NO_FILEUPLOADED")+" ("+(i("CS_ALLOWED_TYPES")||"PDF, JPG, JPEG, PNG")+"; ≤ 5MB)",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!S}))))}function ho(e){let{t:o,document:i,setDocuments:a,documents:l,validateFile:s,makeDocumentsValidator:u,mdms:c,setFormErrors:d}=e;const[p,f]=n.useState(null),[m,v]=n.useState((null==i?void 0:i.fileStoreId)||null),[h,g]=n.useState(null),[y,E]=n.useState(!1),S=window.location.href.includes("citizen");n.useEffect(()=>{p&&function(){try{E(!0);const e=tt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",p,Digit.ULBService.getStateId())).then(function(e){var t,n;if(E(!1),(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var r,i;const t=null==e||null===(r=e.data)||void 0===r||null===(i=r.files[0])||void 0===i?void 0:i.fileStoreId;v(t),b(t)}else g(o("CS_FILE_UPLOAD_ERROR")),b(null)})},function(){E(!1),g(o("CS_FILE_UPLOAD_ERROR")),b(null)});e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[p]);const b=e=>{const t=[...null==l?void 0:l.filter(e=>(null==e?void 0:e.documentType)!==(null==i?void 0:i.code)),...e?[{documentType:null==i?void 0:i.code,fileStoreId:e,documentUid:e}]:[]];if(!L.isEqual(t,l)){a(t);const e=u(c)(t);d(e)}};return r.createElement("div",{style:{marginBottom:"24px"}},y&&r.createElement(t.Loader,null),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}},o(null==i?void 0:i.code.replaceAll(".","_"))+(null!=i&&i.required?" *":""))),r.createElement(t.LabelFieldPair,null,r.createElement("div",{className:"field",style:{width:"100%",maxWidth:!S&&"500px"}},r.createElement(t.UploadFile,{onUpload:function(e){const t=e.target.files&&e.target.files[0];if(!t)return;const n=s(t,null==i?void 0:i.code);if(n)return g(o(n)),void b(null);g(null),f(t)},onDelete:()=>{v(null),g(null),b(null)},message:m?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:"OWNER.OWNERPHOTO"===(null==i?void 0:i.code)||"PET.PETPHOTO"===(null==i?void 0:i.code)?".jpeg, .jpg, .png":".pdf, .jpeg, .jpg, .png",buttonType:"button",error:Boolean(h)}),h&&r.createElement("div",{style:{color:"#d4351c",fontSize:"12px",marginTop:"4px",marginBottom:"10px"}},h))))}const go={step:1,isValid:!1,formData:{}},yo=function(e,t){switch(void 0===e&&(e=go),t.type){case"UPDATE_ADSNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_ADSNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_ADS_NEW_APPLICATION_FORM":return go;default:return e}},Eo={ADSCreate:e=>{var n,a,s,u;const d=l.useQueryClient(),p=i.useRouteMatch(),{t:f}=o.useTranslation(),{pathname:m}=i.useLocation(),v=i.useHistory(),h=Digit.ULBService.getStateId();let g=[];const[y,E,S]=Digit.Hooks.useSessionStorage("ADS_CREATE",{});let{data:b,isLoading:_}=Digit.Hooks.ads.useMDMS(h,"PropertyTax","CommonFieldsConfig");function A(e,t,n,r,o){if(void 0===o&&(o=!1),"owners"===e){let n=y.owners||[];n[r]=t,E(c({},y,{[e]:[...n]}))}else if("units"===e){let e=y.units||[];e=t,E(c({},y,{units:e}))}else E(c({},y,{[e]:c({},y[e],t)}));((e,t,n,r)=>{let o,i=m.split("/").pop(),a=i.charAt(i.length-1),l=!1;Number(parseInt(i))||"0"==i||"-1"==i?"-1"==i||"-2"==i?(i=m.slice(0,-3),i=i.split("/").pop(),l=!0):(i=m.slice(0,-2),i=i.split("/").pop(),l=!0):l=!1,isNaN(a)||(l=!0);let{nextStep:s={}}=g.find(e=>e.route===(i||"0")),u=v.push;if(e&&(u=v.replace),n&&(s=r),null===s)return u(p.path+"/check");o=isNaN(s.split("/").pop())&&l&&"map"!==s?p.path+"/"+s+"/"+t:p.path+"/"+s,u(o)})(n,r,o,e)}const D=()=>{},C=()=>{};if(_)return r.createElement(t.Loader,null);b=M,b.forEach(e=>{g=g.concat(e.body.filter(e=>!e.hideInCitizen))}),g.indexRoute="searchads";const T=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("ADSCheckPage"),x=null===(s=Digit)||void 0===s||null===(u=s.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ADSAcknowledgement");return r.createElement(i.Switch,null,g.map((e,t)=>{const{component:n,texts:o,inputs:a,key:l}=e,s="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return r.createElement(i.Route,{path:p.path+"/"+e.route,key:t},r.createElement(s,{config:{texts:o,inputs:a,key:l},onSelect:A,onSkip:D,t:f,formData:y,onAdd:C}))}),r.createElement(i.Route,{path:p.path+"/check"},r.createElement(T,{onSubmit:function(){try{return v.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),r.createElement(i.Route,{path:p.path+"/acknowledgement"},r.createElement(x,{data:y,onSuccess:()=>{S(),d.invalidateQueries("ADS_CREATE")}})),r.createElement(i.Route,null,r.createElement(i.Redirect,{to:p.path+"/"+g.indexRoute})))},ADSSearch:e=>{var o,l;let{t:s,onSelect:u,config:d,userType:p,formData:f}=e;i.useLocation();const m=Digit.UserService.getUser().info,[v,h]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].cartDetails||(null==f||null===(o=f.adslist)||void 0===o?void 0:o.cartDetails)||[]),[g,y]=n.useState(null==f?void 0:f.adType),[E,S]=n.useState(null==f?void 0:f.location),[b,_]=n.useState(null==f?void 0:f.faceArea),[A,D]=n.useState(!0),[C,T]=n.useState(null==f?void 0:f.fromDate),[x,N]=n.useState([]),[w,I]=n.useState(null==f?void 0:f.toDate),[L,k]=n.useState(f.adslist&&f.adslist[0]&&f.adslist[0].Searchdata||(null==f||null===(l=f.adslist)||void 0===l?void 0:l.Searchdata)||[]),[O,R]=n.useState(null),[P,M]=n.useState(!1),[B,F]=n.useState(""),[j,H]=n.useState((null==f?void 0:f.nightLight)||{i18nKey:"Yes",code:"Yes",value:"true"}),U=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),[z,W]=n.useState(!1);let q=[],V=[],G=[];const{data:K}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"AdType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.AdType.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:Y}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"Location"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.Location.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:$}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"FaceArea"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.FaceArea.map(e=>({i18nKey:""+e.name,code:""+e.code,name:""+e.name,active:""+e.active}))}}),{data:X}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"Advertisement",[{name:"CalculationType"}],{select:e=>{var t;return null==e||null===(t=e.Advertisement)||void 0===t?void 0:t.CalculationType}});K&&K.map(e=>{q.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Y&&Y.map(e=>{V.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),$&&$.map(e=>{G.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const Z=Digit.Hooks.ads.useADSSlotSearch();let J={advertisementSlotSearchCriteria:[{bookingId:"",addType:L.addType,bookingStartDate:L.bookingStartDate,bookingEndDate:L.bookingEndDate,faceArea:L.faceArea,tenantId:U,location:L.location,nightLight:L.nightLight,isTimerRequired:!1}]};n.useEffect(()=>{var e;if(Z.data&&null!==(e=Z.data)&&void 0!==e&&e.advertisementSlotAvailabiltityDetails){var t;const e=null===(t=Z.data)||void 0===t?void 0:t.advertisementSlotAvailabiltityDetails.map((e,t)=>({slotId:t+1,addType:""+s(e.addType),addTypeCode:e.addType,faceAreaCode:e.faceArea,faceArea:""+s(e.faceArea),locationCode:e.location,location:""+s(e.location),nightLight:!1===e.nightLight?"No":"Yes",bookingDate:e.bookingDate,price:L.unitPrice,status:"AVAILABLE"===e.slotStaus?r.createElement("div",{className:"sla-cell-success"},"Available"):r.createElement("div",{className:"sla-cell-error"},"Booked")}));ee(t=>JSON.stringify(t)!==JSON.stringify(e)?e:t),ne(e=>e||!0)}},[Z.data,L]);const[Q,ee]=n.useState(""),[te,ne]=n.useState(!1),re=[{Header:""+s("ADS_TYPE"),accessor:"addType"},{Header:""+s("ADS_FACE_AREA"),accessor:"faceArea"},{Header:""+s("ADS_NIGHT_LIGHT"),accessor:"nightLight"},{Header:""+s("ADS_DATE"),accessor:"bookingDate"},{Header:""+s("ADS_STATUS"),accessor:"status"}],{control:oe}=a.useForm(),ie=()=>{let e,t=f.adslist&&f.adslist[0];"citizen"===p?(e=c({},t,{Searchdata:L,cartDetails:v,adsType:g,selectedLocation:E,selectedFace:b,selectNight:j,fromDate:C,toDate:w,existingDataSet:B}),u(d.key,c({},f[d.key],e),!1,0)):(e=c({},t,{Searchdata:L,cartDetails:v,adsType:g,selectNight:j,selectedLocation:E,selectedFace:b,fromDate:C,toDate:w,existingDataSet:B}),u(d.key,e,!1,0))};n.useEffect(()=>{"citizen"===p&&ie()},[v,g,j,b,E,L]);const ae=[{id:"selection",Header:e=>r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:x.length===Q.length,onChange:()=>{if(x.length===Q.length)N([]);else{const e=Q.filter(e=>"Available"===e.status.props.children).map(e=>e.slotId);N(e)}}})),Cell:e=>{let{row:t}=e;return r.createElement("div",{style:{paddingLeft:"50px"}},r.createElement("input",{type:"checkbox",checked:x.includes(t.original.slotId),onChange:()=>(e=>{const t=Q[e].slotId;N(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])})(t.index),disabled:"Available"!==t.original.status.props.children}))}},...re];return n.useEffect(()=>{if(null!=f&&f.adType&&null!=f&&f.faceArea&&null!=f&&f.fromDate&&null!=f&&f.toDate&&null!=f&&f.nightLight&&null!=f&&f.location&&X){var e,t,n,r,o;let s,u=null==f||null===(e=f.location)||void 0===e?void 0:e.value;const c=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===u);if(c){var i,a,l;const e="CalculationType_"+(null==f||null===(i=f.faceArea)||void 0===i?void 0:i.code);s=null==c||null===(a=c[e])||void 0===a||null===(l=a[0])||void 0===l?void 0:l.amount}const d={addType:null==f||null===(t=f.adType)||void 0===t?void 0:t.code,faceArea:null==f||null===(n=f.faceArea)||void 0===n?void 0:n.code,location:null==f||null===(r=f.location)||void 0===r?void 0:r.code,nightLight:null==f||null===(o=f.nightLight)||void 0===o?void 0:o.value,bookingStartDate:null==f?void 0:f.fromDate,bookingEndDate:null==f?void 0:f.toDate,unitPrice:s};JSON.stringify(d)!==JSON.stringify(L)&&k(d)}},[f,X]),n.useEffect(()=>{if(O){const e=setTimeout(()=>{R(null)},1500);return()=>clearTimeout(e)}},[O]),n.useEffect(()=>{L.addType&&Z.mutate(J)},[L]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen"),r.createElement(t.FormStep,{config:d,onSelect:ie,onSkip:()=>u(),t:s},r.createElement(t.CardHeader,null,s("ADS_SEARCH_HEADER")),r.createElement(t.CardLabel,null,""+s("ADS_TYPE")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"adsType",defaultValue:g,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:g,select:e=>{y(e)},placeholder:"Select Advertisement Type",option:q,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_LOCATION")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"selectedLocation",defaultValue:E,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:E,select:e=>{S(e)},placeholder:"Select Ad Type",option:V,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FACE_AREA")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(a.Controller,{control:oe,name:"adsType",defaultValue:b,rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>r.createElement(t.Dropdown,{className:"form-field",selected:b,select:e=>{_(e)},placeholder:"Select Ad Type",option:G,optionKey:"i18nKey",t:s})}),r.createElement(t.CardLabel,null,""+s("ADS_FROM_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"fromDate",value:C,onChange:function(e){T(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),r.createElement(t.CardLabel,null,""+s("ADS_TO_DATE")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.TextInput,{t:s,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"toDate",value:w,onChange:function(e){I(e.target.value)},style:{width:"EMPLOYEE"===m.type?"50%":"86%"},min:new Date((new Date).setDate((new Date).getDate()+1)).toISOString().split("T")[0],rules:{required:s("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||s("ERR_DEFAULT_INPUT_FIELD_MSG")}}),r.createElement(t.CardLabel,null,""+s("ADS_NIGHT_LIGHT")," ",r.createElement("span",{className:"astericColor"},"*")),r.createElement(t.RadioButtons,{t:s,options:[{i18nKey:"Yes",code:"Yes",value:"true"},{i18nKey:"No",code:"No",value:"false"}],optionsKey:"code",name:"selectNight",value:j,selectedOption:j,innerStyles:{display:"inline-block",marginLeft:"10px",paddingBottom:"2px",marginBottom:"2px"},onSelect:H,isDependent:!0}),r.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"15px"}},r.createElement(t.SubmitBar,{label:s("ES_COMMON_SEARCH"),onSubmit:()=>{const e=null==g?void 0:g.code,t=C,n=w,r=null==b?void 0:b.code,o=null==E?void 0:E.value,i=null==j?void 0:j.value;let a;const l=null==X?void 0:X.find(e=>(null==e?void 0:e.location)===o);if(l){var u,c;const e="CalculationType_"+r;a=null==l||null===(u=l[e])||void 0===u||null===(c=u[0])||void 0===c?void 0:c.amount}if(g&&t&&n&&r&&o&&i){if(new Date(t)>new Date(n))return void R({error:!0,label:s("ADS_INVALID_DATE_RANGE")});k({addType:e,faceArea:r,location:o,nightLight:i,bookingStartDate:t,bookingEndDate:n,unitPrice:a})}else R({error:!0,label:s("PLEASE_FILL_ALL_FIELDS_TO_SEARCH")})}}),r.createElement(t.SubmitBar,{label:s("ADS_ADD_TO_CART"),onSubmit:()=>{if(0===x.length)return void R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")});const e=Q.filter(e=>x.includes(e.slotId)),t=v.map(e=>({slotId:e.slotId,addType:e.addType,location:e.location,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})),n=e.map(e=>({slotId:e.slotId,addTypeCode:e.addTypeCode,faceAreaCode:e.faceAreaCode,locationCode:e.locationCode,addType:e.addType,location:e.location,faceArea:e.faceArea,price:e.price,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,status:e.status.props.children}));if(n.some(e=>t.some(t=>t.addType===e.addType&&t.location===e.location&&t.faceArea===e.faceArea&&t.nightLight===e.nightLight&&t.bookingDate===e.bookingDate)))return R({error:!0,label:s("ADS_ITEM_ALREADY_IN_CART")}),void N([]);const r={};[...t,...n].forEach(e=>{const t=e.addType+"-"+e.location+"-"+e.faceArea+"-"+e.nightLight;r[t]||(r[t]=[]),r[t].push(e)});for(let e in r){const t=r[e].sort((e,t)=>e.slotId-t.slotId);for(let e=1;e<t.length;e++)if(t[e].slotId-t[e-1].slotId>1)return R({error:!0,label:s("ADS_SLOT_DATE_NOT_CONSECUTIVE")}),void N([])}h(e=>[...e,...n]),R({success:!0,label:n.length+" item(s) added to cart."}),N([])}}),r.createElement("div",null,r.createElement(t.SubmitBar,{label:s("ADS_VIEW_CART"),onSubmit:()=>{v.length>0?W(!0):R({error:!0,label:s("ADS_NO_ITEMS_IN_CART")})}})),r.createElement("div",{class:"container",style:{width:"1px"}},r.createElement("div",{style:{width:"1px",position:"relative"}},r.createElement("div",{style:{position:"absolute",right:"83px",backgroundColor:"#FFFFFF",color:"#008000",padding:"4px",borderRadius:"30px",margin:"1px 0 1px 0",width:"31px",height:"30px",textAlign:"center",transform:"translateX(100%)"}},r.createElement("div",null," ",v.length)))),z&&r.createElement(qe,{onClose:()=>{W(!1)},cartDetails:v,setCartDetails:h}),r.createElement(t.SubmitBar,{label:s("ADS_BOOK_NOW"),onSubmit:()=>{0===v.length?R({error:!0,label:s("ADS_SELECT_AT_LEAST_ONE_SLOT")}):A?M(!0):ie()}}))),te&&r.createElement(t.Card,{style:{overflowX:"auto"}},r.createElement(Be,{t:s,data:Q,columns:ae,getCellProps:e=>({style:{minWidth:"140px",padding:"20px",fontSize:"16px"}}),isPaginationRequired:!1,totalRecords:Q.length,style:{width:"100%",overflowX:"auto"}})),O&&r.createElement(t.Toast,{error:O.error,warning:O.warning,label:s(O.label),onClose:()=>{R(null)}}),P&&r.createElement(Ue,{t:s,closeModal:()=>M(!1),actionCancelOnSubmit:()=>M(!1),onSubmit:()=>{ie(),M(!1)},setExistingDataSet:F,Searchdata:v}))},ADSCitizenDetails:e=>{var o,a,l,s,u,d,p,f,m,v,h,g,y,E,S;let{t:b,config:_,onSelect:A,userType:D,formData:C,value:T=C.adslist}=e;i.useLocation();let x=window.location.href.charAt(window.location.href.length-1),N={};const w=Digit.UserService.getUser().info,I=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),L=Digit.Hooks.ads.useADSCreateAPI(),[k,O]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].applicantName||(null==C||null===(o=C.applicant)||void 0===o?void 0:o.applicantName)||(null==T||null===(a=T.existingDataSet)||void 0===a||null===(l=a.applicant)||void 0===l?void 0:l.applicantName)||""),[R,P]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].emailId||(null==C||null===(s=C.applicant)||void 0===s?void 0:s.emailId)||(null==T||null===(u=T.existingDataSet)||void 0===u||null===(d=u.applicant)||void 0===d?void 0:d.emailId)||""),[M,B]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].mobileNumber||(null==T||null===(p=T.existingDataSet)||void 0===p||null===(f=p.applicant)||void 0===f?void 0:f.mobileNumber)||(null==C||null===(m=C.applicant)||void 0===m?void 0:m.mobileNumber)||(null==w?void 0:w.mobileNumber)),[F,j]=n.useState(C.applicant&&C.applicant[x]&&C.applicant[x].alternateNumber||(null==C||null===(v=C.applicant)||void 0===v?void 0:v.alternateNumber)||(null==T||null===(h=T.existingDataSet)||void 0===h||null===(g=h.applicant)||void 0===g?void 0:g.alternateNumber)||""),H=()=>{let e=C.applicant&&C.applicant[x],t=null==T?void 0:T.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:e.light,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));L.mutate({bookingApplication:{tenantId:I,applicantDetail:{applicantName:k,applicantMobileNo:M,applicantAlternateMobileNo:F,applicantEmailId:R},cartDetails:t,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0},{onSuccess:t=>{var n;const r=null==t||null===(n=t.bookingApplication[0])||void 0===n?void 0:n.draftId;let o;"citizen"===D?(o=c({},e,{applicantName:k,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),A(_.key,c({},C[_.key],o),!1,x)):(o=c({},e,{applicantName:k,mobileNumber:M,alternateNumber:F,emailId:R,draftId:r}),A(_.key,o,!1,x))}})};return n.useEffect(()=>{"citizen"===D&&H()},[]),r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ze,{currentStep:1}):null,r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(nt,{timerValues:null==T||null===(y=T.existingDataSet)||void 0===y||null===(E=y.timervalue)||void 0===E?void 0:E.timervalue,SlotSearchData:null==T?void 0:T.cartDetails,draftId:null==T||null===(S=T.existingDataSet)||void 0===S?void 0:S.draftId})),r.createElement(et,null))),r.createElement(t.FormStep,{config:_,onSelect:H,onSkip:()=>A(),t:b,isDisabled:!k||!M||!R},r.createElement("div",null,r.createElement(t.CardLabel,null,""+b("ADS_APPLICANT_NAME")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",placeholder:"Enter Applicant Name",value:k,onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");O(t)},style:{width:"EMPLOYEE"===w.type?"51.6%":null},ValidationRequired:!0},N={pattern:"^[a-zA-Z ]+$",type:"tel",title:b("CHB_NAME_ERROR_MESSAGE")})),r.createElement(t.CardLabel,null,""+b("ADS_MOBILE_NUMBER")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.MobileNumber,{value:M,name:"mobileNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Applicant Register Mobile Number",onChange:e=>function(e){B(e.target.value)}({target:{value:e}}),pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_ALT_MOBILE_NUMBER")),r.createElement(t.MobileNumber,{value:F,name:"alternateNumber",style:{width:"EMPLOYEE"===w.type?"50%":null},placeholder:"Enter Alternate Mobile Number",onChange:e=>function(e){j(e.target.value)}({target:{value:e}}),required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),r.createElement(t.CardLabel,null,""+b("ADS_EMAIL_ID")," ",r.createElement("span",{className:"check-page-link-button"},"*")),r.createElement(t.TextInput,c({t:b,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:R,placeholder:"Enter Applicant Email Id",style:{width:"EMPLOYEE"===w.type?"51.6%":null},onChange:function(e){P(e.target.value)},ValidationRequired:!0},N={required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:b("CHB_NAME_ERROR_MESSAGE")})))))},ADSAddress:e=>{var o;let i,{t:a,value:l={},onChange:s=(()=>{}),onBlur:u=(()=>{}),errorsP:d}=e;i="CITIZEN"===(null===(o=JSON.parse(window.localStorage.getItem("user-info")))||void 0===o?void 0:o.type)?window.localStorage.getItem("CITIZEN.CITY"):Digit.ULBService.getCurrentPermanentCity();const[p,f]=n.useState((null==l?void 0:l.addressId)||""),[m,v]=n.useState((null==l?void 0:l.doorNo)||""),[h,g]=n.useState((null==l?void 0:l.houseNo)||""),[y,E]=n.useState((null==l?void 0:l.houseName)||""),[S,b]=n.useState((null==l?void 0:l.streetName)||""),[_,A]=n.useState((null==l?void 0:l.addressline1)||""),[D,C]=n.useState((null==l?void 0:l.addressline2)||""),[T,x]=n.useState((null==l?void 0:l.landmark)||""),[N,w]=n.useState((null==l?void 0:l.pincode)||""),[I,L]=n.useState((null==l?void 0:l.city)||""),[k,O]=n.useState((null==l?void 0:l.locality)||""),[R,P]=n.useState({});n.useEffect(()=>{f((null==l?void 0:l.addressId)||""),v((null==l?void 0:l.doorNo)||""),g((null==l?void 0:l.houseNo)||""),E((null==l?void 0:l.houseName)||""),b((null==l?void 0:l.streetName)||""),A((null==l?void 0:l.addressline1)||""),C((null==l?void 0:l.addressline2)||""),x((null==l?void 0:l.landmark)||""),w((null==l?void 0:l.pincode)||""),L((null==l?void 0:l.city)||""),O((null==l?void 0:l.locality)||"")},[l]),n.useEffect(()=>{null!=l&&l.city&&L(l.city)},[l]);const M=n.useRef(s);n.useEffect(()=>{M.current=s},[s]);const B=n.useRef(u);n.useEffect(()=>{B.current=u},[u]);const F=function(e){var t,n,r,o,i;void 0===e&&(e={});const a=null!=(t=null!=(n=e.city)?n:I)?t:(null==l?void 0:l.city)||"",s=null!=(r=null!=(o=e.locality)?o:k)?r:(null==l?void 0:l.locality)||"",u=c({addressId:p,doorNo:m,houseNo:h,houseName:y,streetName:S,addressline1:_,addressline2:D,landmark:T,pincode:N,city:a,cityCode:"object"==typeof a?a.code||a.city&&a.city.code||"":a||"",locality:s,localityCode:"object"==typeof s?s.code||s:s||""},e);null===(i=M.current)||void 0===i||i.call(M,u)},j=(e,t)=>{const n=["doorNo","addressId","addressline2"],r=(null==t?void 0:t.trim())||"";n.includes(e)||t&&""!==r?"city"===e||"locality"===e?!/^[a-zA-Z\s]{2,}$/.test(r)||r.length<2?P(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 letters and can only contain letters and spaces"})):P(t=>c({},t,{[e]:""})):n.includes(e)?P(t=>c({},t,{[e]:""})):P(r.length<2?t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" must contain at least 2 characters"}):t=>c({},t,{[e]:""})):P(t=>c({},t,{[e]:e.replace(/([A-Z])/g," $1")+" is required"}))};n.useEffect(()=>{var e;if(null!=d&&null!==(e=d.address)&&void 0!==e&&e.message){const e=d.address.message.replace("Address missing:","").split(",").map(e=>e.trim()),t={};e.forEach(e=>{t[e]="This field is required"}),P(e=>c({},e,t))}},[d]);const H={marginTop:"-18px",color:"red"};return r.createElement("div",null,r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_ID"):"Address ID"),r.createElement(t.TextInput,{value:p,onChange:e=>{const t=e.target.value;f(t),F({addressId:t}),j("addressId",t)},onBlur:()=>B.current&&B.current()}),(R.addressId||d)&&r.createElement(t.CardLabelError,{style:H},R.addressId),r.createElement(t.CardLabel,null,a?a("ADS_DOOR_NO"):"Door No"),r.createElement(t.TextInput,{value:m,onChange:e=>{const t=e.target.value;v(t),F({doorNo:t}),j("doorNo",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.doorNo)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.doorNo),r.createElement(t.CardLabel,null,a?a("ADS_HOUSE_NO"):"House No"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:h,onChange:e=>{const t=e.target.value;g(t),F({houseNo:t}),j("houseNo",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.houseNo)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.houseNo),r.createElement(t.CardLabel,null,a?a("ADS_HOUSE_NAME"):"House Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:y,onChange:e=>{const t=e.target.value;E(t),F({houseName:t}),j("houseName",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.houseName)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.houseName),r.createElement(t.CardLabel,null,a?a("ADS_STREET_NAME"):"Street Name"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:S,onChange:e=>{const t=e.target.value;b(t),F({streetName:t}),j("streetName",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.streetName)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.streetName),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_LINE1"):"Address Line 1"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:_,onChange:e=>{const t=e.target.value;A(t),F({addressline1:t}),j("addressline1",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.addressline1)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.addressline1),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_LINE2"):"Address Line 2"),r.createElement(t.TextInput,{value:D,onChange:e=>{const t=e.target.value;C(t),F({addressline2:t}),j("addressline2",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.addressline2)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.addressline2),r.createElement(t.CardLabel,null,a?a("ADS_LANDMARK"):"Landmark"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextArea,{value:T,onChange:e=>{const t=e.target.value;x(t),F({landmark:t}),j("landmark",t)},onBlur:()=>B.current&&B.current(),style:{width:"50%"}}),(null==R?void 0:R.landmark)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.landmark),R.locality&&r.createElement("div",{style:{color:"red"}},R.locality),r.createElement(t.CardLabel,null,a?a("ADS_CITY"):"City"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:I,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");L(t),F({city:t}),j("city",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.city)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.city),r.createElement(t.CardLabel,null,a?a("ADS_LOCALITY"):"Locality"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:k,onChange:e=>{const t=e.target.value.replace(/[^a-zA-Z\s]/g,"");O(t),F({locality:t}),j("locality",t)},onBlur:()=>B.current&&B.current()}),(null==R?void 0:R.locality)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.locality),r.createElement(t.CardLabel,null,a?a("ADS_ADDRESS_PINCODE"):"Pincode"," ",r.createElement("span",{style:{color:"red"}},"*")),r.createElement(t.TextInput,{value:N,onChange:e=>{const t=String(e.target.value||"").replace(/\D/g,"").slice(0,6);w(t),F({pincode:t}),P(t?e=>c({},e,{pincode:""}):e=>c({},e,{pincode:"Pincode is required"}))},maxLength:6}),(null==R?void 0:R.pincode)&&r.createElement(t.CardLabelError,{style:H},null==R?void 0:R.pincode))},ADSWFCaption:Ke,LocationSearchCard:Me,NewSiteInspectionStepperForm:e=>{const a=mo.map(e=>c({},e,{currStepConfig:fo.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(i.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement($r,{stepsList:a,onSubmit:e=>{},step:f,setStep:e=>{u(Qr(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},NewSiteInspectionStepperFormOne:e=>{let{config:o,onGoNext:i,onBackClick:a,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.ads.useADSDocumentsMDMS(m,"Advertisements",["Documents"]),h=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:h,config:o.currStepConfig,onSubmit:function(e){var t;const n=(e=>{var t;const n=((null==e||null===(t=e.NDC)||void 0===t?void 0:t.Documents)||[]).filter(e=>null==e?void 0:e.required).map(e=>e.code);return function(e){void 0===e&&(e=[]);const t={};if(null==n||!n.length)return t;for(const o of n){var r;if(!(null===(r=e)||void 0===r?void 0:r.some(e=>{var t,n;return(null==e||null===(t=e.documentType)||void 0===t||null===(n=t.includes)||void 0===n?void 0:n.call(t,o))&&((null==e?void 0:e.filestoreId)||(null==e?void 0:e.fileStoreId))}))){t.missingRequired="ADS_MISSING_REQUIRED_DOCUMENTS";break}}return t}})(v)((null==h||null===(t=h.documents)||void 0===t?void 0:t.documents)||[]);if(null!=n&&n.missingRequired)return f("Please upload all required documents"),void d(!0);i()},onFormValueChange:function(e,t){L.isEqual(t,h)||u(Jr(o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},ADSSiteInspection:e=>{var o,i,a;let{t:l,config:s,onSelect:u,formData:d}=e;Digit.ULBService.getStateId();const[p,f]=n.useState((null==d||null===(o=d.documents)||void 0===o?void 0:o.documents)||[]),[m,v]=n.useState(null),[h,g]=n.useState(!0),[y,E]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:_}=Digit.Hooks.pt.usePropertyMDMS(S,"NDC",["Documents"]),A=()=>{let e;e=c({},d.documents,{documents:p}),u(s.key,e)};return n.useEffect(()=>{var e,t;const n=(null==_||null===(e=_.NDC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>null==e?void 0:e.required))||[],r=p||[],o=n.every(e=>r.some(t=>{var n;return(null==t||null===(n=t.documentType)||void 0===n?void 0:n.includes(e.code))&&(null==t?void 0:t.fileStoreId)}));g(!(o&&!m))},[p,_,m]),r.createElement("div",null,b?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:l,config:s,onSelect:A,onSkip:()=>u(),isDisabled:h,onAdd:function(){}},null==_||null===(i=_.NDC)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>r.createElement(vo,{key:t,document:e,t:l,error:m,setError:v,setDocuments:f,documents:p,setCheckRequiredFields:E,handleSubmit:A})),m&&r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement(t.Toast,{label:m,onClose:()=>v(null),error:!0}),r.createElement("button",{type:"button","aria-label":"Dismiss",onClick:()=>v(null),style:{background:"transparent",border:"none",fontSize:"18px",cursor:"pointer",lineHeight:1},title:l("CS_ACTION_CLOSE")||"Close"},"×"))))},ADSSiteMaster:po,NewSiteMasterFormStepOne:e=>{let{config:i,onGoNext:a}=e;const{t:l}=o.useTranslation(),u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement(po,{goNext:function(e){u(Jr(i.key,e)),a()},currentStepData:m,t:l}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewSiteMasterStepperForm:e=>{const a=uo.map(e=>c({},e,{currStepConfig:so.filter(t=>t.stepNumber===e.stepNumber)})),{t:l}=(i.useHistory(),o.useTranslation()),u=s.useDispatch(),[d,p]=n.useState(null),f=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{u({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]),r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},l("ADS_REGISTRATION_APPLICATION")),r.createElement($r,{stepsList:a,onSubmit:e=>{},step:f,setStep:e=>{u(Qr(e))}}),d&&r.createElement(t.Toast,{error:d.key,label:l(d.label),onClose:()=>{p(null)},isDleteBtn:"true"}))},ADSWFReason:Ge,ADSWFApplicationTimeline:$e,ADSDocumentDetails:e=>{var o,i,a,l,s,u,d,p;let{t:f,config:m,onSelect:v,formData:h,value:g=h.adslist}=e;const[y,E]=n.useState((null==h||null===(o=h.documents)||void 0===o?void 0:o.documents)||(null==g||null===(i=g.existingDataSet)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.documents)||[]),[S,b]=n.useState(null),[_,A]=n.useState(!0),[D,C]=n.useState(!1),T=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),x=Digit.Hooks.ads.useADSCreateAPI(),N=Digit.ULBService.getStateId(),{isLoading:w,data:I}=Digit.Hooks.ads.useADSDocumentsMDMS(N,"Advertisement","Documents");return n.useEffect(()=>{var e;let t=0;null==I||null===(e=I.Advertisement)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;y.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),A("0"!=t&&0!=t||!(y.length>0))},[y,D]),r.createElement("div",null,r.createElement(Ze,{currentStep:3}),r.createElement(t.Card,null,r.createElement("div",{style:{position:"relative"}},r.createElement(t.CardSubHeader,{style:{position:"absolute",right:0}},r.createElement(nt,{timerValues:null==g||null===(l=g.existingDataSet)||void 0===l||null===(s=l.timervalue)||void 0===s?void 0:s.timervalue,SlotSearchData:null==g?void 0:g.cartDetails,draftId:null==g||null===(u=g.existingDataSet)||void 0===u?void 0:u.draftId})),r.createElement(et,null))),w?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:f,config:m,onSelect:()=>{var e,t,n,r,o,i,a,l,s,u,d,p,f,E,S,b,_,A,D,C,N;let w=null==g?void 0:g.cartDetails.map(e=>({addType:e.addTypeCode,faceArea:e.faceAreaCode,location:e.locationCode,nightLight:"Yes"===e.nightLight,bookingDate:e.bookingDate,bookingFromTime:"06:00",bookingToTime:"05:59",status:"BOOKING_CREATED"}));const I={bookingApplication:{tenantId:T,draftId:null==h||null===(e=h.applicant)||void 0===e?void 0:e.draftId,applicantDetail:{applicantName:null==h||null===(t=h.applicant)||void 0===t?void 0:t.applicantName,applicantMobileNo:null==h||null===(n=h.applicant)||void 0===n?void 0:n.mobileNumber,applicantAlternateMobileNo:null==h||null===(r=h.applicant)||void 0===r?void 0:r.alternateNumber,applicantEmailId:null==h||null===(o=h.applicant)||void 0===o?void 0:o.emailId},addressdetails:{pincode:null==h||null===(i=h.address)||void 0===i?void 0:i.pincode,city:null==h||null===(a=h.address)||void 0===a||null===(l=a.city)||void 0===l||null===(s=l.city)||void 0===s?void 0:s.name,cityCode:null==h||null===(u=h.address)||void 0===u||null===(d=u.city)||void 0===d||null===(p=d.city)||void 0===p?void 0:p.code,locality:null==h||null===(f=h.address)||void 0===f||null===(E=f.locality)||void 0===E?void 0:E.i18nKey,localityCode:null==h||null===(S=h.address)||void 0===S||null===(b=S.locality)||void 0===b?void 0:b.code,streetName:null==h||null===(_=h.address)||void 0===_?void 0:_.streetName,addressLine1:null==h||null===(A=h.address)||void 0===A?void 0:A.addressline1,addressLine2:null==h||null===(D=h.address)||void 0===D?void 0:D.addressline2,houseNo:null==h||null===(C=h.address)||void 0===C?void 0:C.houseNo,landmark:null==h||null===(N=h.address)||void 0===N?void 0:N.landmark},documents:y,cartDetails:w,bookingStatus:"BOOKING_CREATED"},isDraftApplication:!0};let L;x.mutate(I),L=c({},h.documents,{documents:y}),v(m.key,L)},onSkip:()=>v(),isDisabled:_,onAdd:function(){}},r.createElement(t.CardSubHeader,null,f("ADS_PROOF_OF_DOCUMENTS")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardLabelDesc,null,f("ADS_UPLOAD_RESTRICTIONS_SIZE")),null==I||null===(d=I.Advertisement)||void 0===d||null===(p=d.Documents)||void 0===p?void 0:p.map((e,t)=>r.createElement(rt,{key:t,document:e,t:f,error:S,setError:b,setDocuments:E,documents:y,setCheckRequiredFields:C})),S&&r.createElement(t.Toast,{label:S,onClose:()=>b(null),error:!0})))},ADSCheckPage:e=>{var a,l,s,u,d,f,m,v,h,g,y;let{onSubmit:E,value:S={}}=e;const{t:b}=o.useTranslation(),[_,A]=(i.useHistory(),Digit.Hooks.useSessionStorage("ADS_CREATE",{})),{applicant:D,isEditADS:C,isUpdateADS:T,documents:x,address:N}=S,w=C||T?"editbookad":"bookad",I=[{Header:""+b("ADS_TYPE"),accessor:"addType"},{Header:""+b("ADS_FACE_AREA"),accessor:"faceArea"},{Header:b("ADS_NIGHT_LIGHT"),accessor:"nightLight",Cell:e=>{let{value:t}=e;return r.createElement("div",null,b(t?"Yes":"No"))}},{Header:""+b("ADS_DATE"),accessor:"bookingDate"},{Header:b("DELETE_KEY"),accessor:"delete",Cell:e=>{let{row:n}=e;return r.createElement("button",{onClick:()=>L(n.index)},r.createElement(t.DeleteIcon,{className:"delete",fill:"#a82227",style:{cursor:"pointer",marginLeft:"20px"}}))}}],L=e=>{var t;const n=c({},_);null!=n&&null!==(t=n.adslist)&&void 0!==t&&t.cartDetails&&(n.adslist.cartDetails=n.adslist.cartDetails.filter((t,n)=>n!==e)),A(n)},k=(null==_||null===(a=_.adslist)||void 0===a?void 0:a.cartDetails.map(e=>({addType:e.addType,faceArea:e.faceArea,nightLight:e.nightLight,bookingDate:e.bookingDate})))||[],[O,R]=n.useState(!1);return r.createElement(r.Fragment,null,window.location.href.includes("/citizen")?r.createElement(Ze,{currentStep:4}):null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,b("ADS_SUMMARY")),r.createElement(t.CardSubHeader,null,r.createElement(nt,{timerValues:null==_||null===(l=_.adslist)||void 0===l||null===(s=l.existingDataSet)||void 0===s||null===(u=s.timervalue)||void 0===u?void 0:u.timervalue,SlotSearchData:null==_||null===(d=_.adslist)||void 0===d?void 0:d.cartDetails,draftId:null==_||null===(f=_.adslist)||void 0===f||null===(m=f.existingDataSet)||void 0===m?void 0:m.draftId}))),r.createElement("div",null,r.createElement(t.CardText,null,b("ADS_CHECK_CHECK_YOUR_ANSWERS_TEXT")),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_APPLICANT_NAME"),text:""+b(p(null==D?void 0:D.applicantName)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_MOBILE_NUMBER"),text:""+b(p(null==D?void 0:D.mobileNumber)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_ALT_MOBILE_NUMBER"),text:""+b(p(null==D?void 0:D.alternateNumber)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})}),r.createElement(t.Row,{label:b("ADS_EMAIL_ID"),text:""+b(p(null==D?void 0:D.emailId)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/applicant-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_ADDRESS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{label:b("ADS_HOUSE_NO"),text:""+b(p(null==N?void 0:N.houseNo)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_HOUSE_NAME"),text:""+b(p(null==N?void 0:N.houseName)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_STREET_NAME"),text:""+b(p(null==N?void 0:N.streetName)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE1"),text:""+b(p(null==N?void 0:N.addressline1)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_LINE2"),text:""+b(p(null==N?void 0:N.addressline2)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LANDMARK"),text:""+b(p(null==N?void 0:N.landmark)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_CITY"),text:""+b(p(null==N||null===(v=N.city)||void 0===v||null===(h=v.city)||void 0===h?void 0:h.name)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_LOCALITY"),text:""+b(p(null==N||null===(g=N.locality)||void 0===g?void 0:g.i18nKey)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})}),r.createElement(t.Row,{label:b("ADS_ADDRESS_PINCODE"),text:""+b(p(null==N?void 0:N.pincode)),actionButton:r.createElement(it,{jumpTo:"/digit-ui/citizen/ads/"+w+"/address-details"})})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_CART_DETAILS")),r.createElement(Be,{t:b,data:k,columns:I,getCellProps:e=>({style:{minWidth:"150px",padding:"10px",fontSize:"16px",paddingLeft:"20px"}}),isPaginationRequired:!1,totalRecords:null==_||null===(y=_.adslist)||void 0===y?void 0:y.cartDetails.length}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Card,null,x&&(null==x?void 0:x.documents.map((e,t)=>r.createElement(ot,{value:S,Code:null==e?void 0:e.documentType,index:t}))))),r.createElement(t.CheckBox,{label:b("ADS_FINAL_DECLARATION_MESSAGE"),onChange:()=>{R(!O)},styles:{height:"auto"}})),r.createElement(t.SubmitBar,{label:b("ADS_COMMON_BUTTON_SUBMIT"),onSubmit:E,disabled:!O})))},ADSAcknowledgement:e=>{var n;const{state:a}=e.location,{t:l}=o.useTranslation(),s=i.useHistory(),u=null==a?void 0:a.applicationData,c=(window.localStorage.getItem("Citizen.tenant-id"),((null==s||null===(n=s.location)||void 0===n?void 0:n.pathname)||"").split("/").pop());return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:l("ADS_"+(null==u?void 0:u.applicationStatus)+"_HEADER"),applicationNumber:c,info:"REJECTED"===(null==u?void 0:u.applicationStatus)?"":l("ADS_BOOKING_NUMBER"),successful:"REJECTED"!==(null==u?void 0:u.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==u?void 0:u.applicationStatus)?r.createElement(t.CardText,null,l("ADS_"+(null==u?void 0:u.applicationStatus)+"_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{s.push("/digit-ui/citizen")}}),r.createElement(t.SubmitBar,{label:l("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{s.push("/digit-ui/citizen/ads-home")}}),"PENDINGPAYMENT"===(null==u?void 0:u.applicationStatus)&&r.createElement(t.SubmitBar,{label:l("COMMON_MAKE_PAYMENT"),onSubmit:()=>{s.push("/digit-ui/citizen/payment/my-bills/ADV/"+c)}}))))},ADSAddressField:lt,ADSCard:at,ADSMyApplications:()=>{const{t:e}=o.useTranslation(),a=Digit.UserService.getUser().info,[l,s]=n.useState(null);let u,d=window.location.href.split("/").pop();isNaN(parseInt(d))||(u=d);let p=isNaN(parseInt(d))?{limit:"200",sortOrder:"ASC",sortBy:"createdTime",offset:"0",tenantId:"pb.testing",mobileNumber:null==a?void 0:a.mobileNumber}:{limit:"250",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:"pb.testing",mobileNumber:null==a?void 0:a.mobileNumber};n.useEffect(()=>{s(p)},[d]);const{isLoading:f,data:m,refetch:v}=Digit.Hooks.ads.useADSSearch({filters:l}),h=(null==m?void 0:m.bookingApplication)||[];n.useEffect(()=>{v()},[]);const[g,y]=n.useState(1),[E,S]=n.useState(!1),b=5*g,_=b-5,A=(null==h?void 0:h.slice(_,b))||[],D=Math.ceil(((null==h?void 0:h.length)||0)/5),C={paginationControls:{display:"flex",justifyContent:"center",alignItems:"center",gap:"12px",margin:"20px 0"},paginationBtn:{backgroundColor:"#2947a3",color:"#fff",border:"none",padding:"8px 12px",borderRadius:"50%",fontSize:"18px",cursor:"pointer",transition:"background-color 0.2s ease"},disabledBtn:{backgroundColor:"#ccc",cursor:"not-allowed"},paginationInfo:{fontWeight:500,color:"#333"}};return f?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement(t.Header,null,e("ADS_MY_BOOKINGS_HEADER")+" "+(h?"("+h.length+")":"")),r.createElement("div",null,(null==A?void 0:A.length)>0&&A.map((t,n)=>r.createElement("div",{key:n},r.createElement(At,{application:t,tenantId:"pb.testing",buttonLabel:e("ADS_SUMMARY")}))),!(null!=h&&h.length)>0&&r.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("ADS_NO_APPLICATION_FOUND_MSG")),(null==h?void 0:h.length)>5&&r.createElement("div",{style:C.paginationControls},r.createElement("button",{style:c({},C.paginationBtn,1===g?C.disabledBtn:{}),disabled:1===g,onClick:()=>{S(!0),setTimeout(()=>{y(e=>e-1),S(!1)},500)}},"←"),r.createElement("span",{style:C.paginationInfo},_+1+"-"+Math.min(b,h.length)+" of "+h.length),r.createElement("button",{style:c({},C.paginationBtn,g===D?C.disabledBtn:{}),disabled:g===D,onClick:()=>{S(!0),setTimeout(()=>{y(e=>e+1),S(!1)},500)}},"→"))),r.createElement("div",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION")," ",r.createElement(i.Link,{to:"/digit-ui/citizen/ads/bookad/searchads"},r.createElement("button",{style:{padding:"8px opx",fontWeight:"700",display:"block"}},e("ADS_NEW_BOOKING")+" +"))))},ApplicationDetails:()=>{var e,a,l,s,u,p,f,m,y,E,S,b,_,A,D,C,T,x,N;const{id:w}=i.useParams(),{t:I}=o.useTranslation(),L=i.useHistory(),k=Digit.ULBService.getCurrentTenantId(),[O,R]=n.useState({}),P=null==k?void 0:k.split(".")[0],[M,B]=n.useState(null),[F,j]=n.useState(null),[H,U]=n.useState({}),z=Array.isArray(null==H?void 0:H.Documents)?H.Documents:Array.isArray(null==H?void 0:H.documents)?H.documents:[],[W,q]=n.useState({}),[V,G]=n.useState(!1),[K,Y]=n.useState(!1);n.useEffect(()=>{var e,t,n;const r=(z||[]).map(e=>{var t;return e?e.fileStoreId?e.fileStoreId:e.fileStoreIds&&Array.isArray(e.fileStoreIds)?e.fileStoreIds[0]:e.fileId?e.fileId:e.documentDetailId?e.documentDetailId:null!=e&&null!==(t=e.file)&&void 0!==t&&t.fileStoreId?e.file.fileStoreId:null:null}).filter(Boolean);if(null==r||!r.length)return void G(!1);G(!0);const o=(null===(e=Digit)||void 0===e||null===(t=e.ULBService)||void 0===t||null===(n=t.getStateId)||void 0===n?void 0:n.call(t))||null;Digit.UploadServices.Filefetch(r,o||k).then(e=>{var t,n;let r=null!=(t=null!=(n=null==e?void 0:e.data)?n:null==e?void 0:e.files)?t:e;if(Array.isArray(r)){const e={};r.forEach(t=>{if(!t)return;if("string"==typeof t)return;const n=t.fileStoreId||t.fileId||t.documentDetailId,r=t.url||t.fileUrl||("string"==typeof t?t:null);n&&r&&(e[n]=r)}),r=e}q(r||{})}).catch(e=>{console.error("Filefetch error:",e),q({})}).finally(()=>G(!1))},[JSON.stringify(z)]);const{isLoading:$,data:X,refetch:Z}=Digit.Hooks.ads.useADSSearch({tenantId:k,filters:{bookingNo:w}}),J=null!=(e=null==X||null===(a=X.bookingApplication)||void 0===a?void 0:a[0])?e:[],Q=J,ee=Q||J||O||null,te=v(X),ne=n.useRef(),[re,oe]=n.useState(!1),[ie,ae]=n.useState(null),[le,se]=n.useState(!1),[ue,ce]=n.useState(!1),{data:de,isLoading:pe}=(null===(l=Digit.Hooks.ads)||void 0===l||null===(s=l.useADSCreateAPI)||void 0===s||s.call(l,k,!1),Digit.Hooks.useRecieptSearch({tenantId:k,businessService:"adv-services",consumerCodes:(null==H||null===(u=H.applicantData)||void 0===u?void 0:u.applicationNo)||w,isEmployee:!1},{enabled:!!(null!=H&&null!==(p=H.applicantData)&&void 0!==p&&p.applicationNo||w)}));Digit.Hooks.useClickOutside(ne,()=>{oe(!1)},re);const fe=Digit.Hooks.useWorkflowDetails({tenantId:k,id:null==Q?void 0:Q.bookingNo,moduleCode:"advandhoarding"}),me=(null==fe||null===(f=fe.data)||void 0===f||null===(m=f.nextActions)||void 0===m?void 0:m.map(e=>({action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase()})))||[];n.useEffect(()=>{if(Q){var e,t,n,r,o;const i={applicationNo:null==Q?void 0:Q.bookingNo,name:null==Q||null===(e=Q.applicantDetail)||void 0===e?void 0:e.applicantName,email:null==Q||null===(t=Q.applicantDetail)||void 0===t?void 0:t.applicantEmailId,mobile:null==Q||null===(n=Q.applicantDetail)||void 0===n?void 0:n.applicantMobileNo,address:null==Q||null===(r=Q.address)||void 0===r?void 0:r.addressLine1,pincode:null==Q||null===(o=Q.address)||void 0===o?void 0:o.pincode,bookingStatus:null==Q?void 0:Q.bookingStatus,paymentDate:null!=Q&&Q.paymentDate?new Date(Q.paymentDate).toLocaleDateString():"",receiptNo:null==Q?void 0:Q.receiptNo,auditDetails:null==Q?void 0:Q.auditDetails},a=(e=>{const t=new Set;return e.filter(e=>!t.has(e.uuid)&&(t.add(e.uuid),!0))})((null==Q?void 0:Q.documents)||[]);U({applicantData:i,Documents:a})}else U({})},[Q]),n.useEffect(()=>{Y($||!Q),R(Q?c({},Q,{applicationDetails:[{title:"ADS_DETAILS_SUMMARY_LABEL"}]}):{})},[$,Q]);const ve=function(e){try{var t,n,r,o,i,a,l;const s=null!=(t=null!=(n=null!=(r=null==X||null===(o=X.Applications)||void 0===o?void 0:o[0])?r:null==X||null===(i=X.data)||void 0===i?void 0:i[0])?n:null==X?void 0:X[0])?t:Q;if(!s)return B({key:"error",message:"Application data not loaded. Try reloading the page."}),j("Application data not loaded"),Promise.resolve();const u=(null==e||null===(a=e.Licenses)||void 0===a?void 0:a[0])||e;if(!u||!u.action)return B({key:"error",message:"No workflow action provided"}),j("No workflow action provided"),Promise.resolve();const d=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==u?void 0:u.assignee)||(null==u?void 0:u.assignees)||(null==u?void 0:u.assigneeUuid)),p=(null==fe||null===(l=fe.data)||void 0===l?void 0:l.applicationBusinessService)||"ADV",f=c({tenantId:k},s,{documents:(null==s?void 0:s.documents)||(null==s?void 0:s.Documents)||[],workflow:c({businessService:p,action:u.action,comments:u.comment||u.action||"",documents:null!=u&&u.wfDocuments?null==u?void 0:u.wfDocuments:null},d?{assignes:d}:{})});return null!=u&&u.assignee||"FORWARD"!==u.action?Promise.resolve(tt(function(){var e;if(null===(e=Digit)||void 0===e||!e.ADSServices||"function"!=typeof Digit.ADSServices.update)throw new Error("Digit.ADSServices.update is not available in this runtime");return Promise.resolve(Digit.ADSServices.update({bookingApplication:f},k)).then(function(e){var t,n;"SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)?(B({key:"success",message:"Successfully updated the status"}),j("Successfully updated the status"),null==fe||null===(n=fe.revalidate)||void 0===n||n.call(fe),setTimeout(()=>{L.push("/digit-ui/employee/ads/inbox")},1200),ae(null),se(!1)):(B({key:"error",message:(null==I?void 0:I("SOMETHING_WENT_WRONG"))||"Failed to update"}),j("Failed to update"))})},function(e){console.error("submitAction error:",e),B({key:"error",message:"Something went wrong"}),j("Something went wrong")})):(B({key:"error",message:"Assignee is mandatory"}),j("Assignee is mandatory"),Promise.resolve())}catch(e){return Promise.reject(e)}};let he=[];he.push({label:I("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(e){try{try{if(!e)throw new Error("Booking Application data is missing");Tr(e,I),B({key:"success",message:I("ADV_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY")}),j("Acknowledgement Downloaded Successfully")}catch(e){console.error("Acknowledgement download error:",e),B({key:"error",message:""+e.message}),j("Something Went Wrong")}return Promise.resolve()}catch(e){return Promise.reject(e)}}(ee)}),de&&(null==de||null===(y=de.Payments)||void 0===y?void 0:y.length)>0&&!1===pe&&(he.push({label:I("CHB_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,Kr);try{return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,te)]},"adv-bill")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==de||null===(e=de.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==de?void 0:de.Payments[0]})}}),de&&(null==de?void 0:de.Payments.length)>0&&!pe&&he.push({label:I("CHB_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,Gr);try{function r(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let e=te,o=null==e?void 0:e.permissionLetterFilestoreId;const i=function(){if(!o)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,e)]},"adv-permissionletter")).then(function(e){o=null==e?void 0:e.filestoreIds[0],Z()})}();return Promise.resolve(i&&i.then?i.then(r):r())}catch(e){return Promise.reject(e)}}({tenantId:null==de||null===(e=de.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==de?void 0:de.Payments[0]})}}));const ge=h(null==Q?void 0:Q.cartDetails),[ye,Ee]=n.useState(!1);return $||K?r.createElement(t.Loader,null):r.createElement("div",{className:"employee-main-application-details"},r.createElement("div",{style:{marginBottom:"15px"}},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},I("ADS_APP_OVER_VIEW_HEADER")))),r.createElement(t.Card,null,(null==H||null===(E=H.applicantData)||void 0===E||null===(S=E.auditDetails)||void 0===S?void 0:S.createdTime)&&"PENDING_FOR_PAYMENT"===(null==H||null===(b=H.applicantData)||void 0===b?void 0:b.bookingStatus)&&r.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},r.createElement(_t,{t:I,createTime:null==H||null===(_=H.applicantData)||void 0===_||null===(A=_.auditDetails)||void 0===A?void 0:A.createdTime,onExpire:e=>Ee(e)})),r.createElement(t.CardSubHeader,null,I("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,(null==H?void 0:H.applicantData)&&Object.entries(null==H?void 0:H.applicantData).filter(e=>{let[t,n]=e;return!(null==n||"string"==typeof n&&""===n.trim()||Array.isArray(n)&&0===n.length||"object"==typeof n&&!Array.isArray(n)&&0===Object.keys(n).length)}).filter(e=>{let[t]=e;return!["auditDetails","paymentDate"].includes(t)}).map(e=>{let[n,o]=e;return r.createElement(t.Row,{key:n,label:I(g(n)),text:Array.isArray(o)?o.map(e=>I("object"==typeof e?(null==e?void 0:e.code)||"N/A":e||"N/A")).join(", "):I("object"==typeof o?(null==o?void 0:o.code)||"N/A":o||"N/A")})}))),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,I("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")),r.createElement(xr,{cartDetails:null!=ge?ge:[],t:I})),r.createElement(t.Card,null,r.createElement(t.CardSubHeader,null,I("ADS_APPLICATION_DOCUMENTS_OVERVIEW")),r.createElement(n.Fragment,null,(null==ee||null===(D=ee.documents)||void 0===D?void 0:D.length)>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"30px"}},null==ee?void 0:ee.documents.map((e,t)=>r.createElement("div",{key:t},r.createElement(ot,{value:null==ee?void 0:ee.documents,Code:null==e?void 0:e.documentType,index:t}),I(null==e?void 0:e.documentType)))):r.createElement("div",{style:{padding:"0 1.5rem"}},I("TL_NO_DOCUMENTS_MSG"))),r.createElement($e,{application:ee,id:(null==H||null===(C=H.applicantData)||void 0===C?void 0:C.applicationNo)||w,userType:"employee"})),!(null!=fe&&fe.isLoading)&&Array.isArray(me)&&(null==me?void 0:me.length)>0&&r.createElement(t.ActionBar,null,re&&r.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_ADS",options:me,optionKey:"buttonLabel",t:I,onSelect:e=>{!function(e){if(e){if("PAY"===e.action){var t;const e=(null==H||null===(t=H.applicantData)||void 0===t?void 0:t.applicationNo)||w;return L.push("/digit-ui/employee/payment/collect/adv-services/"+e+"/"+k+"?tenantId="+k)}if("SUBMIT"===e.action||"INITIATE"===e.action)return ve({Licenses:[{action:e.action,comment:e.action||""}]});ae({action:e.action,comment:""}),se(!0)}}(e),oe(!1)}}),r.createElement(t.SubmitBar,{ref:ne,label:I("WF_TAKE_ACTION"),onSubmit:()=>oe(!re),disabled:ye||"BOOKING_CREATED"===(null==H||null===(T=H.applicantData)||void 0===T?void 0:T.bookingStatus)})),le?r.createElement(Or,{t:I,action:ie,tenantId:k,state:P,bookingNo:w,applicationDetails:X,applicationData:null==X?void 0:X.applicationData,closeModal:()=>{ae(null),se(!1)},submitAction:ve,actionData:(null==fe||null===(x=fe.data)||void 0===x?void 0:x.processInstances)||[],businessService:(null==fe||null===(N=fe.data)||void 0===N?void 0:N.applicationBusinessService)||"ADV",moduleCode:"advandhoarding",workflowActions:me,showToast:M,closeToast:()=>{B(null)},errors:F}):null,M&&r.createElement(t.Toast,{error:"error"===M.key,label:F,onClose:()=>B(null),isDleteBtn:!0}))},ADSApplicationDetails:()=>{var e,a,l,s,u,p,f,m,g,y;const[E,S]=n.useState([]),{t:b}=o.useTranslation(),{acknowledgementIds:_,tenantId:A}=(i.useHistory(),i.useParams()),[D,C]=n.useState(!1),[T,x]=n.useState(null),[N,w]=n.useState(!1),[I,L]=n.useState(null),[k,O]=n.useState(!1),R=n.useRef(),[P,M]=n.useState(null),{isLoading:B,error:F,data:j,refetch:H}=(Digit.Hooks.useStore.getInitData(),Digit.Hooks.ads.useADSSearch({tenantId:A,filters:{bookingNo:_}})),U=v(j);console.log("new_data my here",U),Digit.Hooks.ads.useADSCreateAPI(A,!1),n.useEffect(()=>{H()},[_,H]);const z=yn(j,"bookingApplication",[]),W=yn(j,"bookingApplication[0].bookingNo",[]);let q=z&&z.length>0&&z[0]||{};const V=q,G=Digit.Hooks.useWorkflowDetails({tenantId:A,id:_,moduleCode:"advandhoarding"}),{data:K,isLoading:Y}=Digit.Hooks.useRecieptSearch({tenantId:A,businessService:"adv-services",consumerCodes:_,isEmployee:!1},{enabled:!!_}),$=(null==G||null===(e=G.data)||void 0===e||null===(a=e.nextActions)||void 0===a?void 0:a.map(e=>c({},e,{action:null==e?void 0:e.action,buttonLabel:((null==e?void 0:e.action)||"").replace(/_/g," ").toUpperCase(),assignee:(null==e?void 0:e.assignee)||null,nextStateUuid:(null==e?void 0:e.nextState)||null})))||[];n.useEffect(()=>{S($)},[JSON.stringify($)]),Digit.Hooks.useClickOutside&&Digit.Hooks.useClickOutside(R,()=>{w(!1)},N);const{isLoading:X}=Digit.Hooks.ads.useADSSearch({tenantId:A,filters:{bookingNo:W,audit:!0}},{enabled:!0});let Z=[];if(Z=null!=(l=null==V?void 0:V.documents)?l:[],B||X||null!=G&&G.isLoading)return r.createElement(t.Loader,null);let J=b("CS_NA");if(null!=q&&null!==(s=q.additionalDetails)&&void 0!==s&&s.documentDate){var Q;const e=new Date(null==q||null===(Q=q.additionalDetails)||void 0===Q?void 0:Q.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];J=e.getDate()+" "+t+" "+e.getFullYear()}let ee=[];const te=h(null==q?void 0:q.cartDetails);return ee.push({label:b("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(e){try{try{if(!e)throw new Error("Booking Application data is missing");Tr(e,b),x({key:"success",message:"ADV_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY"}),M("Acknowledgment downloaded successfully")}catch(e){console.error("Acknowledgement download error:",e),x({key:"error",message:"ADV_ACKNOWLEDGEMENT_DOWNLOAD_ERROR: "+e.message}),M("Something went wrong")}return Promise.resolve()}catch(e){return Promise.reject(e)}}(V)}),K&&(null==K?void 0:K.Payments.length)>0&&!Y&&(ee.push({label:b("CHB_FEE_RECEIPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,wr);try{return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,U)]},"adv-bill")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==K||null===(e=K.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==K?void 0:K.Payments[0]})}}),ee.push({label:b("CHB_PERMISSION_LETTER"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;d(e,Nr);try{function r(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:o})).then(function(e){window.open(e[o],"_blank")})}let e=U,o=null==e?void 0:e.permissionLetterFilestoreId;const i=function(){if(!o)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},n,e)]},"adv-permissionletter")).then(function(e){o=null==e?void 0:e.filestoreIds[0]})}();return Promise.resolve(i&&i.then?i.then(r):r())}catch(e){return Promise.reject(e)}}({tenantId:null==K||null===(e=K.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==K?void 0:K.Payments[0]})}})),r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},r.createElement(t.Header,{styles:{fontSize:"32px"}},b("ADS_BOOKING_DETAILS")),ee&&ee.length>0&&r.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>C(!D),displayOptions:D,options:ee})),r.createElement(t.Card,null,r.createElement(t.StatusTable,null),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICANT_DETAILS")),r.createElement(t.StatusTable,null,r.createElement(t.Row,{className:"border-none",label:b("ADS_APPLICANT_NAME"),text:(null==q||null===(u=q.applicantDetail)||void 0===u?void 0:u.applicantName)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_MOBILE_NUMBER"),text:(null==q||null===(p=q.applicantDetail)||void 0===p?void 0:p.applicantMobileNo)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_EMAIL_ID"),text:(null==q||null===(f=q.applicantDetail)||void 0===f?void 0:f.applicantEmailId)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("PTR_ADDRESS"),text:(null==q||null===(m=q.address)||void 0===m?void 0:m.addressLine1)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_ADDRESS_PINCODE"),text:(null==q||null===(g=q.address)||void 0===g?void 0:g.pincode)||b("CS_NA")}),r.createElement(t.Row,{className:"border-none",label:b("ADS_BOOKING_NO"),text:null==q?void 0:q.bookingNo}),r.createElement(t.Row,{className:"border-none",label:b("BOOKING_STATUS"),text:b(null==q?void 0:q.bookingStatus)}),(null==q?void 0:q.receiptNo)&&r.createElement(t.Row,{className:"border-none",label:b("CITIZEN_SUCCESS_ADVT_HOARDINGS_PAYMENT_RECEIPT_NO"),text:null==q?void 0:q.receiptNo})),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")),r.createElement(xr,{cartDetails:null!=te?te:[],t:b}),r.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},b("ADS_DOCUMENTS_DETAILS")),r.createElement(t.StatusTable,null,(null===(y=Z)||void 0===y?void 0:y.length)>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"30px"}},Z.map((e,t)=>r.createElement("div",{key:t},r.createElement(ot,{value:Z,Code:null==e?void 0:e.documentType,index:t}),b(null==e?void 0:e.documentType)))):r.createElement("div",{style:{padding:"0 1.5rem"}},b("TL_NO_DOCUMENTS_MSG"))),r.createElement($e,{application:V,id:null==q?void 0:q.bookingNo,userType:"citizen"})),T&&r.createElement(t.Toast,{error:"error"===T.key,label:P||F,onClose:()=>x(null),isDleteBtn:!0})))},ADSSearchApplication:_,ADSRequiredDoc:e=>{var n,o,i,a;let{t:l,onSelect:s,formData:u,value:c=u.adslist}=e;Digit.ULBService.getCurrentTenantId();const d=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:p,data:m={}}=Digit.Hooks.ads.useADSDocumentsMDMS(d,"Advertisement","Documents");let v=null==m||null===(n=m.Advertisement)||void 0===n?void 0:n.Documents;return r.createElement(r.Fragment,null,r.createElement(t.Card,null,r.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"}},r.createElement(t.CardHeader,null,l("MODULE_ADS")),r.createElement(t.CardSubHeader,null,r.createElement(nt,{timerValues:null==c||null===(o=c.existingDataSet)||void 0===o||null===(i=o.timervalue)||void 0===i?void 0:i.timervalue,SlotSearchData:null==c?void 0:c.cartDetails,draftId:null==c||null===(a=c.existingDataSet)||void 0===a?void 0:a.draftId}))),r.createElement("div",null,r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_HEADER")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_SUB_TEXT")),r.createElement(t.CardSubHeader,null,l("ADS_REQ_SCREEN_LABEL")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_DOC_REQ_SCREEN_LABEL_TEXT")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_TYPES")),r.createElement(t.CardText,{className:"primaryColor"},l("ADS_UPLOAD_RESTRICTIONS_SIZE")),r.createElement("div",null,p&&r.createElement(t.Loader,null),Array.isArray(v)?v.map((e,n)=>{let{code:o,dropdownData:i}=e;return r.createElement("div",{key:n},r.createElement(t.CardSubHeader,null,n+1,". ",l("ADS_"+f(o,".","_"))),i.map((e,n)=>r.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",l("ADS_"+f(null==e?void 0:e.code,".","_")))))}):null)),r.createElement("span",null,r.createElement(t.SubmitBar,{label:l("ADS_COMMON_NEXT"),onSubmit:s}))))},LocationSearch:z,GIS:Ye,NewADSStepperForm:e=>{let{userType:a}=e;const l=("employee"===a?eo:to).map(e=>c({},e,{currStepConfig:("employee"===a?Xr:Zr).filter(t=>t.stepNumber===e.stepNumber)})),{t:u}=(i.useHistory(),o.useTranslation()),d=s.useDispatch(),[p,f]=n.useState(null),m=s.useSelector(e=>e.ads.ADSNewApplicationFormReducer),v=m.formData,h=m.step;Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{d({type:"RESET_ADS_NEW_APPLICATION_FORM"})},[]);const g=null==v?void 0:v.reservationExpiry;return r.createElement("div",{className:"pageCard"},r.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"500",color:"#1C1D1F"},divider:!0},u("ADS_REGISTRATION_APPLICATION"),g&&r.createElement(_t,{t:u,createTime:g})),r.createElement($r,{stepsList:l,onSubmit:e=>{},step:h,setStep:e=>{d(Qr(e))}}),p&&r.createElement(t.Toast,{error:p.key,label:u(p.label),onClose:()=>{f(null)},isDleteBtn:"true"}))},NewADSStepFormOne:e=>{var i,a;let{config:l,onGoNext:u,onBackClick:c}=e;const d=s.useDispatch(),{t:p}=o.useTranslation(),[f,m]=n.useState(!1),[v,h]=n.useState(""),g="undefined"!=typeof window&&(null===(i=window.location)||void 0===i||null===(a=i.href)||void 0===a?void 0:a.includes("citizen")),y=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData});return r.createElement(r.Fragment,null,r.createElement("div",{className:!g&&"employeeCard"},r.createElement(no,{onGoBack:function(e){c(l.key,e)},goNext:function(e){d(Jr(l.key,e)),u()},currentStepData:y,t:p})," ",f&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{m(!1),h("")}})," "))},NewADSStepFormTwo:e=>{var i,a;let{config:l,onBackClick:u,onGoNext:c}=e;const{t:d}=o.useTranslation(),p=s.useDispatch(),[f,m]=n.useState(!1),[v,h]=n.useState(""),g=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData}),y="undefined"!=typeof window&&(null===(i=window.location)||void 0===i||null===(a=i.href)||void 0===a?void 0:a.includes("citizen"));return r.createElement(r.Fragment,null,r.createElement("div",{className:!y&&"employeeCard"},r.createElement(ao,{onGoBack:function(e){u(l.key,e)},goNext:function(e){p(Jr(l.key,e)),c()},currentStepData:g,t:d}),f&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{m(!1),h("")}})))},NewADSStepFormThree:e=>{let{config:o,onGoNext:i,onBackClick:a,t:l}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,f]=n.useState(""),m=Digit.ULBService.getStateId(),{isLoading:v,data:h}=Digit.Hooks.ads.useADSDocumentsMDMS(m),g=s.useSelector(function(e){return e.ads.ADSNewApplicationFormReducer.formData&&e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.ads.ADSNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}});return n.useEffect(()=>{if(c){const e=setTimeout(()=>d(null),2e3);return()=>clearTimeout(e)}},[c]),r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:g,config:o.currStepConfig,onSubmit:function(e){const t=function(e){if(!v){var t;const n=(null==e||null===(t=e.documents)||void 0===t?void 0:t.documents)||[],r=(h||[]).filter(e=>e.required).map(e=>e.code),o=n.map(e=>e.documentType);return r.filter(e=>!o.includes(e))}}(e);if(t.length>0)return f("You haven't uploaded: "+t[0].replace(".","_").toUpperCase()),d(!0),void setTimeout(()=>{d(!1)},3e3);i()},onFormValueChange:function(e,t){L.isEqual(t,g)||u(Jr(null==o?void 0:o.key,t))},label:l(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),c&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),f("")}}))},NewADSStepFormFour:e=>{let{config:i,onGoNext:a,onBackClick:l}=e;const u=s.useDispatch(),{t:d}=o.useTranslation(),[p,f]=n.useState(!1),[m,v]=n.useState(""),{currentStepData:h,isLoading:g}=s.useSelector(e=>{var t,n,r,o;return{currentStepData:null==e||null===(t=e.ads)||void 0===t||null===(n=t.ADSNewApplicationFormReducer)||void 0===n?void 0:n.formData,isLoading:(null===(r=e.ads.ADSNewApplicationFormReducer)||void 0===r?void 0:r.isLoading)||!(null!==(o=e.ads.ADSNewApplicationFormReducer)&&void 0!==o&&o.formData)}});return g?null:r.createElement(n.Fragment,null,r.createElement(lo,{onGoBack:e=>{const t=c({},h,{penalty:e});l(i.key,t)},goNext:e=>{const t=c({},h,{penalty:e});u(Jr(null==i?void 0:i.key,t)),a()},currentStepData:null==h?void 0:h.penalty,t:d}),p&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{f(!1),v("")}}))},NewADSStepFormFive:function(e){var o,a,l,u,d,p,f,m=e.config,v=e.onBackClick,h=e.t;const g=i.useHistory(),[y,E]=n.useState(!1),S=n.useRef(),[b,_]=n.useState([]);var A=s.useDispatch(),D=n.useState(!1),C=D[0],T=D[1];const x=window.location.href.includes("citizen"),N=x?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");var w=n.useState(""),I=w[0],k=w[1],O=s.useSelector(function(e){return e&&e.ads&&e.ads.ADSNewApplicationFormReducer&&e.ads.ADSNewApplicationFormReducer.formData||{}},L.isEqual),R=n.useRef(O);n.useEffect(function(){R.current=O},[O]);const P=(null==O?void 0:O.bookingNo)||(null==O||null===(o=O.CreatedResponse)||void 0===o?void 0:o.bookingNo)||"",M=Digit.Hooks.useWorkflowDetails({tenantId:N,id:P,moduleCode:"advandhoarding-services"});n.useEffect(()=>{var e,t;const n=null==M?void 0:M.data;if(!n)return void _(e=>e&&e.length?[]:e);const r=n.processInstances&&n.processInstances.length?n.processInstances[0]:null,o=(r&&r.nextActions||n.nextActions||[]||[]).map(e=>({action:e.action,roles:e.roles||[],assignee:e.assignee||e.assignees||e.assigner||null,nextStateUuid:e.nextState||e.nextStateUuid||null,nextState:e.nextState||e.nextStateUuid||null,buttonLabel:(e.action||"").replace(/_/g," ").toUpperCase(),comment:e.comment||e.action||"",_rawAction:e})),i=Digit.UserService.getUser();let a=(null==i||null===(e=i.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.map(e=>e.code))||[];if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){var l,s,u;const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};a=(null==t||null===(l=t.value)||void 0===l||null===(s=l.info)||void 0===s||null===(u=s.roles)||void 0===u?void 0:u.map(e=>e.code))||a}const c=o.filter(e=>!e.roles||0===e.roles.length||a.some(t=>e.roles.includes(t))).filter(e=>"SUBMIT"===e.action);_(e=>L.isEqual(e,c)?e:c)},[null==M||null===(a=M.data)||void 0===a?void 0:a.applicationBusinessService,null==M||null===(l=M.data)||void 0===l||null===(u=l.processInstances)||void 0===u?void 0:u.length]);var B=n.useRef(!0),F=n.useRef(null),j=n.useRef(null);const H=n.useCallback(function(e){void 0===e&&(e=void 0);try{var t,n,r,o,i,a,l,s,u,d;const p=null==M?void 0:M.data,f=L.merge(L.cloneDeep(R.current),e||{}),m=null!==(t=e)&&void 0!==t&&t.action?e:(null===(n=e)||void 0===n||null===(r=n.Licenses)||void 0===r?void 0:r[0])||null,v=m.nextState||m.nextStateUuid||m.status||"",y=function(e){if(!e)return null;const t=e=>e?"string"==typeof e?e:e.uuid||e.id||e.employeeId||e.code||null:null;if(Array.isArray(e)){const n=e.map(e=>t(e)).filter(Boolean);return n.length?n:null}const n=t(e);return n?[n]:null}((null==m?void 0:m.assignee)||(null==m?void 0:m.assignees)||(null==m?void 0:m.assigneeUuid));if(!m||!m.action)return A(Jr("finalSubmission",f)),Promise.resolve();A(Jr("finalSubmission",f));const E=(null==p||null===(o=p.data)||void 0===o||null===(i=o.processInstances)||void 0===i||null===(a=i.state)||void 0===a?void 0:a.applicationStatus)||"",S={bookingApplication:c({tenantId:N},null==f?void 0:f.CreatedResponse,{bookingStatus:"INITIATED"===E?"BOOKING_CREATED":"REFUND"===E?"CANCELLED":E||(null==f||null===(l=f.CreatedResponse)||void 0===l?void 0:l.bookingStatus),documents:(null==f||null===(s=f.documents)||void 0===s||null===(u=s.documents)||void 0===u?void 0:u.documents)||(null==f?void 0:f.documents)||(null==f?void 0:f.Documents)||[],workflow:c({businessService:(null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService)||"ADV",states:v||E||"",action:m.action||"",comments:m.comment||m.action||"",status:E},y?{assignee:y}:{})})};if((null==m||!m.assignee)&&"FORWARD"===m.action)return k("Assignee is mandatory"),T(!0),Promise.resolve();const b=tt(function(){return Promise.resolve(Digit.ADSServices.update(S,N)).then(function(e){var t;if("SUCCESSFUL"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)||"SUCCESSFUL"===(null==e?void 0:e.status)){var n,r,o,i,a,l,s,u,d,p,m;const e=c({},(null===(n=Digit)||void 0===n||null===(r=n.Store)||void 0===r||null===(o=r.getState)||void 0===o||null===(i=o.call(r))||void 0===i||null===(a=i.ads)||void 0===a||null===(l=a.ADSNewApplicationFormReducer)||void 0===l?void 0:l.formData)||R.current||{},f),t=Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}));A(Jr("formData",t)),g.replace(x?"/digit-ui/citizen/ads/adsservice/response/"+(null===(s=R.current)||void 0===s||null===(u=s.CreatedResponse)||void 0===u?void 0:u.bookingNo):"/digit-ui/employee/ads/adsservice/response/"+(null===(d=R.current)||void 0===d||null===(p=d.CreatedResponse)||void 0===p?void 0:p.bookingNo),{applicationData:null===(m=R.current)||void 0===m?void 0:m.CreatedResponse})}else k(h&&h("SOMETHING_WENT_WRONG")||"Failed to update"),T(!0)})},function(e){console.error("ADS update error:",e),k(h&&h("SOMETHING_WENT_WRONG")||"Failed to update"),T(!0)});return Promise.resolve(b&&b.then?b.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[N,h,A,null==M||null===(d=M.data)||void 0===d?void 0:d.applicationBusinessService,g,x]);function U(e){v(m.key,e)}var z=n.useCallback(function(){var e=arguments.length>1?arguments[1]:void 0;B.current?B.current=!1:e&&(L.isEqual(e,R.current)||F.current&&L.isEqual(e,F.current)||(j.current&&clearTimeout(j.current),j.current=setTimeout(function(){const t=L.omitBy(L.cloneDeep(e),e=>void 0===e);if("summary"===(null==m?void 0:m.key)&&1===Object.keys(t).length&&""===t.summary)return;const n=L.merge({},R.current,t);Object.keys(t).length>0&&!L.isEqual(n,R.current)&&(F.current=n,A(Jr("formData",n)))},100)))},[A,m&&m.key]);n.useEffect(function(){return function(){j.current&&clearTimeout(j.current)}},[]);const W=r.useMemo(()=>{const e=O||{};return void 0===e.summary?c({},e,{summary:""}):e},[O]);let q=Digit.UserService.getUser();null==q||null===(p=q.info)||void 0===p||null===(f=p.roles)||void 0===f||f.map(e=>e.code);const V=r.useMemo(()=>b||[],[b]);return Digit.Hooks.useClickOutside(S,()=>{E(!1)},y),r.createElement(r.Fragment,null,r.createElement(t.FormComposer,{defaultValues:W,config:m&&m.currStepConfig,onSubmit:e=>H(c({},e,{_isFormSubmit:!0})),onFormValueChange:z,label:h&&m&&m.texts?h(m.texts.submitBarLabel):"",currentStep:m&&m.currStepNumber,onBackClick:U}),C&&r.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:I,onClose:function(){T(!1),k("")}}),r.createElement(t.ActionBar,null,r.createElement(t.SubmitBar,{label:h("CS_COMMON_BACK"),onSubmit:U,variant:"secondary"}),y&&r.createElement(t.Menu,{localeKeyPrefix:"",options:V,optionKey:"action",t:h,onSelect:e=>{!function(e){var t;if(!e)return;const n=new Set(["SUBMIT","INITIATE","PAY"]),r=e.fromStateCode||(null===(t=e._rawStateObj)||void 0===t?void 0:t.state)||null,o=e.toStateCode||null,i=n.has(e.action)?o||r||e.nextStateUuid:r||o||e.nextStateUuid;H({action:e.action,nextState:e.nextState||e.nextStateUuid||null,status:i||"",comment:e.comment||e.action||"",assignee:e.assignee||null,_rawAction:e})}(e),E(!1)}}),r.createElement(t.SubmitBar,{ref:S,label:h("WF_TAKE_ACTION"),onSubmit:()=>E(!y)})))},ADSCitizenDetailsNew:no,ADSCitizenSecond:ao,ADSSelectProofIdentity:e=>{var o;let{t:i,config:a,onSelect:l,formData:s}=e;const u=Digit.ULBService.getStateId(),[d,p]=n.useState({}),[f,m]=n.useState(null),v={maxBytes:5242880,allowedExtensions:[".pdf",".jpeg",".jpg",".png"]},h=(e,t)=>{var n,r,o;if(!e)return null;const i=v.maxBytes;let a=[...v.allowedExtensions];"OWNER.OWNERPHOTO"!==t&&"PET.PETPHOTO"!==t||(a=[".jpeg",".jpg",".png"]);const l=(null==e||null===(n=e.name)||void 0===n||null===(r=n.toLowerCase)||void 0===r?void 0:r.call(n))||"";return(null===(o=a)||void 0===o?void 0:o.some(e=>null==l?void 0:l.endsWith(e)))?(null==e?void 0:e.size)>i?"CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED":null:"CS_FILE_INVALID_TYPE"},g=e=>{var t;const n=null===(t=e||[])||void 0===t?void 0:t.filter(e=>null==e?void 0:e.required);return function(e){void 0===e&&(e=[]);const t={},r=[],o=Array.isArray(e)?e:[];if(null==n||!n.length)return t;for(const e of n)(null==o?void 0:o.some(t=>{var n;return(null===(n=t.documentType)||void 0===n?void 0:n.includes(null==e?void 0:e.code))&&((null==t?void 0:t.filestoreId)||t.fileStoreId)}))||r.push(i(null==e?void 0:e.code.replaceAll(".","_")));return(null==r?void 0:r.length)>0&&(t.missingRequired="PTR_MISSING_REQUIRED_DOCUMENTS",t.missingDocs=r),t}},{isLoading:y,data:E}=Digit.Hooks.ads.useADSDocumentsMDMS(u),[S,b]=n.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]);n.useEffect(()=>{if(E){const e=g(E)(S);p(e)}},[S,E]),n.useEffect(()=>{var e;const t=(null==s||null===(e=s.documents)||void 0===e?void 0:e.documents)||[];L.isEqual(t,S)||b(t)},[s]);const _=r.useRef();return n.useEffect(()=>{L.isEqual(_.current,S)||(_.current=S,l(a.key,{documents:S}))},[S,a.key]),n.useEffect(()=>{if(f){const e=setTimeout(()=>m(null),2e3);return()=>clearTimeout(e)}},[f]),r.createElement("div",null,y?r.createElement(t.Loader,null):r.createElement(t.FormStep,{t:i,config:a,onSelect:()=>{var e;if((null===(e=Object.keys(d))||void 0===e?void 0:e.length)>0)return m(i((null==d?void 0:d.missingRequired)||"PTR_VALIDATION_ERROR")),void l(a.key,{missingDocs:(null==d?void 0:d.missingDocs)||[]});let t=c({},E,{documents:S});l(a.key,t)},onSkip:()=>l(),isDisabled:Object.keys(d).length>0},Array.isArray(E)&&(null==E?void 0:E.map((e,t)=>{const n=null==S?void 0:S.find(t=>(null==t?void 0:t.documentType)===(null==e?void 0:e.code));return r.createElement(ho,{key:t,document:c({},e,n),t:i,setDocuments:b,documents:S,validateFile:h,makeDocumentsValidator:g,mdms:E,setFormErrors:p,formErrors:d})})),f&&r.createElement(t.Toast,{isDleteBtn:!0,label:f,onClose:()=>m(null),error:!0})))},ADSSummary:function(e){var n,o,i,a,l,u,c,d;let{t:p}=e;const f=s.useDispatch(),m=e=>p?p(e):e,v=s.useSelector(e=>{var t,n;return null==e||null===(t=e.ads)||void 0===t||null===(n=t.ADSNewApplicationFormReducer)||void 0===n?void 0:n.formData}),h=r.useMemo(()=>v||{},[v]),g=(null==h||null===(n=h.CreatedResponse)||void 0===n?void 0:n.applicantDetail)||{},y=(null==h||null===(o=h.ownerDetails)||void 0===o?void 0:o.address)||(null==h||null===(i=h.CreatedResponse)||void 0===i?void 0:i.address)||{},E=Array.isArray(null==h||null===(a=h.documents)||void 0===a||null===(l=a.documents)||void 0===l?void 0:l.documents)?null==h||null===(u=h.documents)||void 0===u||null===(c=u.documents)||void 0===c?void 0:c.documents:Array.isArray(null===(d=h.documents)||void 0===d?void 0:d.documents)?h.documents.documents:Array.isArray(h.documents)?h.documents:[],S={backgroundColor:"#ffffff",padding:"1rem 0",borderRadius:"8px",marginBottom:"1.5rem",boxShadow:"0 2px 6px rgba(18,38,63,0.04)"},b={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem",padding:"0 1.5rem"},_={fontSize:"1.25rem",color:"#0d43a7",fontWeight:"600",margin:0},A={cursor:"pointer",color:"#2e86de",fontWeight:600,fontSize:"0.9rem"},D={display:"flex",justifyContent:"space-between",borderBottom:"1px dashed #e9eef2",padding:"0.6rem 1.5rem",alignItems:"center"},C={flex:"1 1 220px",minWidth:"180px",maxWidth:"260px",backgroundColor:"#fbfcfe",padding:"0.6rem",border:"1px solid #eef3f7",borderRadius:"6px"},T={fontWeight:"500",color:"#333"},x=null==h?void 0:h.ads,N=(e,n)=>r.createElement("div",{style:D},r.createElement("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"}},r.createElement(t.CardLabel,{style:T},e)),r.createElement("div",{style:{textAlign:"right",minWidth:"120px"}},n||"NA"));return r.createElement("div",{className:"application-summary"},r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:S},r.createElement("div",{style:b},r.createElement("h3",{style:_},m("ADS_APPLICANT_DETAILS")),r.createElement("span",{style:A,onClick:()=>f(Qr(2))},m("TL_SUMMARY_EDIT"))),N(m("NOC_APPLICANT_NAME_LABEL"),null==g?void 0:g.applicantName),N(m("CORE_Mobile_Number"),null==g?void 0:g.applicantMobileNo),N(m("CORE_EMAIL_ID"),null==g?void 0:g.applicantEmailId),N(m("CORE_COMMON_PINCODE"),null==y?void 0:y.pincode),N(m("ES_CREATECOMPLAINT_ADDRESS"),null==y?void 0:y.addressLine1))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:S},r.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem"}},r.createElement("h3",{style:_},m("ADS_DETAILS")),r.createElement("span",{style:A,onClick:()=>f(Qr(1))},m("TL_SUMMARY_EDIT"))),r.createElement(xr,{cartDetails:x,t:p}))),r.createElement(t.Card,{className:"summary-section"},r.createElement("div",{style:S},r.createElement("div",{style:b},r.createElement("h3",{style:_},m("ADS_DOCUMENTS_DETAILS")),r.createElement("span",{style:A,onClick:()=>f(Qr(3))},m("TL_SUMMARY_EDIT"))),E.length>0?r.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"1rem",marginTop:"0.5rem"}},E.map((e,t)=>r.createElement("div",{key:t,style:C},r.createElement(ot,{value:E,Code:null==e?void 0:e.documentType,index:t}),m(null==e?void 0:e.documentType)))):r.createElement("div",{style:{padding:"0 1.5rem"}},p("TL_NO_DOCUMENTS_MSG")))))},ADSPenalty:lo,ADSResponseCitizen:e=>{var n;const a=window.location.href.includes("citizen"),{state:l}=e.location,{t:s}=o.useTranslation(),u=i.useHistory(),c=null==l?void 0:l.applicationData,d=a?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id"),p=((null==u||null===(n=u.location)||void 0===n?void 0:n.pathname)||"").split("/").pop();return r.createElement("div",null,r.createElement(t.Card,null,r.createElement(t.Banner,{message:s("ADS_BOOKED_HEADER"),applicationNumber:p,info:"REJECTED"==(null==c?void 0:c.bookingStatus)?"":s("ADS_APPROVAL_NUMBER"),successful:"REJECTED"!=(null==c?void 0:c.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==c?void 0:c.bookingStatus)?r.createElement(t.CardText,null,s("ADS_BOOKED_SUB_HEADER")):null,r.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{u.push(a?"/digit-ui/citizen":"/digit-ui/employee")}}),r.createElement(t.SubmitBar,{label:s("CORE_COMMON_GO_TO_ADS"),onSubmit:()=>{u.push(a?"/digit-ui/citizen/ads-home":"/digit-ui/employee/ads/inbox")}}),r.createElement(t.SubmitBar,{label:s("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),onSubmit:()=>{u.push(a?"/digit-ui/citizen/payment/my-bills/adv-services/"+(null==c?void 0:c.bookingNo):"/digit-ui/employee/payment/collect/adv-services/"+p+"/"+d+"?tenantId="+d)}}))))}},So=e=>{let{stateCode:t,userType:o,tenants:a}=e;const{path:l,url:s}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"ADS",language:u}),Object.entries(Eo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("ADS_TENANTS",a),n.useEffect(()=>"employee"===o&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===o?r.createElement(bt,{path:l,url:s,userType:o}):r.createElement(T,null)},bo=e=>{const{t:i}=o.useTranslation(),[a,l,s]=Digit.Hooks.useSessionStorage("ADS",{});return n.useEffect(()=>{s()},[]),r.createElement(t.CitizenHomeCard,{header:i("ADVERTISEMENT_MODULE"),links:[],Icon:()=>r.createElement(Ve,{className:"fill-path-primary-main"})})};exports.ADSComponents={ADSModule:So,ADSLinks:bo,ADSCard:at,ADS_INBOX_FILTER:e=>r.createElement(O,e),ADSInboxTableConfig:e=>({ADS:{inboxColumns:t=>[{Header:e("ADS_BOOKING_NO"),Cell:e=>{var n,o,a,l;let{row:s}=e;return r.createElement("div",null,r.createElement("span",{className:"link"},r.createElement(i.Link,{to:t.parentRoute+"/applicationsearch/application-details/"+(null==s||null===(n=s.original)||void 0===n||null===(o=n.searchData)||void 0===o?void 0:o.bookingNo)},null===(a=s.original)||void 0===a||null===(l=a.searchData)||void 0===l?void 0:l.bookingNo)))},mobileCell:e=>{var t;return P(null==e||null===(t=e.searchData)||void 0===t?void 0:t.bookingNo)}},{Header:e("ADS_APPLICANT_NAME"),Cell:e=>{var t,n,r,o,i;return R(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(r=n.original)||void 0===r||null===(o=r.searchData)||void 0===o||null===(i=o.applicantDetail)||void 0===i?void 0:i.applicantName))},mobileCell:e=>{var t,n;return P(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.applicantDetail)||void 0===n?void 0:n.applicantName)}},{Header:e("AD _TYPE"),Cell:e=>{var t,n,r,o;let{row:i}=e;return R(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(r=n.cartDetails)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.addType))},mobileCell:e=>{var t,n,r;return P(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.cartDetails)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.addType)}},{Header:e("BOOKING_STATUS"),Cell:t=>{var n,r,o,i,a;let{row:l}=t;return R(e(""+(null==l||null===(n=l.original)||void 0===n||null===(r=n.searchData)||void 0===r?void 0:r.bookingStatus)||""+(null==l||null===(o=l.original)||void 0===o||null===(i=o.workflowData)||void 0===i||null===(a=i.state)||void 0===a?void 0:a.applicationStatus)))},mobileCell:t=>{var n,r,o;return P(e("ES_ADS_COMMON_STATUS_"+((null==t||null===(n=t.searchData)||void 0===n?void 0:n.bookingStatus)||(null==t||null===(r=t.workflowData)||void 0===r||null===(o=r.state)||void 0===o?void 0:o.applicationStatus))))}},{Header:e("ADS_DATE"),Cell:e=>{var t,n;let{row:r}=e;const o=null===(t=r.original)||void 0===t||null===(n=t.searchData)||void 0===n?void 0:n.applicationDate,i=o?new Date(o).toLocaleDateString("en-GB"):"";return R(i)},mobileCell:e=>{var t;const n=null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationDate,r=n?new Date(n).toLocaleDateString("en-GB"):"";return P(r)}}],serviceRequestIdKey:t=>{var n,r;return null==t||null===(n=t[e("ADS_INBOX_UNIQUE_BOOKING_NUMBER")])||void 0===n||null===(r=n.props)||void 0===r?void 0:r.children}}})},exports.ADSLinks=bo,exports.ADSModule=So,exports.ADSReducers=()=>u.combineReducers({ADSNewApplicationFormReducer:yo});
|